Enum Event

pub enum Event {
Show 48 variants Quit { timestamp: u64, }, AppTerminating { timestamp: u64, }, AppLowMemory { timestamp: u64, }, AppWillEnterBackground { timestamp: u64, }, AppDidEnterBackground { timestamp: u64, }, AppWillEnterForeground { timestamp: u64, }, AppDidEnterForeground { timestamp: u64, }, Window { timestamp: u64, window_id: u32, win_event: WindowEvent, }, KeyDown { timestamp: u64, window_id: u32, keycode: Option<Keycode>, scancode: Option<Scancode>, keymod: Mod, repeat: bool, which: u32, raw: u16, }, KeyUp { timestamp: u64, window_id: u32, keycode: Option<Keycode>, scancode: Option<Scancode>, keymod: Mod, repeat: bool, which: u32, raw: u16, }, TextEditing { timestamp: u64, window_id: u32, text: String, start: i32, length: i32, }, TextInput { timestamp: u64, window_id: u32, text: String, }, MouseMotion { timestamp: u64, window_id: u32, which: u32, mousestate: MouseState, x: f32, y: f32, xrel: f32, yrel: f32, }, MouseButtonDown { timestamp: u64, window_id: u32, which: u32, mouse_btn: MouseButton, clicks: u8, x: f32, y: f32, }, MouseButtonUp { timestamp: u64, window_id: u32, which: u32, mouse_btn: MouseButton, clicks: u8, x: f32, y: f32, }, MouseWheel { timestamp: u64, window_id: u32, which: u32, x: f32, y: f32, direction: MouseWheelDirection, mouse_x: f32, mouse_y: f32, }, JoyAxisMotion { timestamp: u64, which: u32, axis_idx: u8, value: i16, }, JoyHatMotion { timestamp: u64, which: u32, hat_idx: u8, state: HatState, }, JoyButtonDown { timestamp: u64, which: u32, button_idx: u8, }, JoyButtonUp { timestamp: u64, which: u32, button_idx: u8, }, JoyDeviceAdded { timestamp: u64, which: u32, }, JoyDeviceRemoved { timestamp: u64, which: u32, }, ControllerAxisMotion { timestamp: u64, which: u32, axis: Axis, value: i16, }, ControllerButtonDown { timestamp: u64, which: u32, button: Button, }, ControllerButtonUp { timestamp: u64, which: u32, button: Button, }, ControllerDeviceAdded { timestamp: u64, which: u32, }, ControllerDeviceRemoved { timestamp: u64, which: u32, }, ControllerDeviceRemapped { timestamp: u64, which: u32, }, ControllerTouchpadDown { timestamp: u64, which: u32, touchpad: i32, finger: i32, x: f32, y: f32, pressure: f32, }, ControllerTouchpadMotion { timestamp: u64, which: u32, touchpad: i32, finger: i32, x: f32, y: f32, pressure: f32, }, ControllerTouchpadUp { timestamp: u64, which: u32, touchpad: i32, finger: i32, x: f32, y: f32, pressure: f32, }, FingerDown { timestamp: u64, touch_id: u64, finger_id: u64, x: f32, y: f32, dx: f32, dy: f32, pressure: f32, }, FingerUp { timestamp: u64, touch_id: u64, finger_id: u64, x: f32, y: f32, dx: f32, dy: f32, pressure: f32, }, FingerMotion { timestamp: u64, touch_id: u64, finger_id: u64, x: f32, y: f32, dx: f32, dy: f32, pressure: f32, }, DollarRecord { timestamp: u64, touch_id: i64, gesture_id: i64, num_fingers: u32, error: f32, x: f32, y: f32, }, MultiGesture { timestamp: u64, touch_id: i64, d_theta: f32, d_dist: f32, x: f32, y: f32, num_fingers: u16, }, ClipboardUpdate { timestamp: u64, }, DropFile { timestamp: u64, window_id: u32, filename: String, }, DropText { timestamp: u64, window_id: u32, filename: String, }, DropBegin { timestamp: u64, window_id: u32, }, DropComplete { timestamp: u64, window_id: u32, }, AudioDeviceAdded { timestamp: u64, which: u32, iscapture: bool, }, AudioDeviceRemoved { timestamp: u64, which: u32, iscapture: bool, }, RenderTargetsReset { timestamp: u64, }, RenderDeviceReset { timestamp: u64, }, User { timestamp: u64, window_id: u32, type_: u32, code: i32, data1: *mut c_void, data2: *mut c_void, }, Unknown { timestamp: u64, type_: u32, }, Display { timestamp: u64, display: Display, display_event: DisplayEvent, },
}
Available on crate feature dep_sdl3 only.
Expand description

Different event types.

Variants§

§

Quit

Fields

§timestamp: u64
§

AppTerminating

Fields

§timestamp: u64
§

AppLowMemory

Fields

§timestamp: u64
§

AppWillEnterBackground

Fields

§timestamp: u64
§

AppDidEnterBackground

Fields

§timestamp: u64
§

AppWillEnterForeground

Fields

§timestamp: u64
§

AppDidEnterForeground

Fields

§timestamp: u64
§

Window

Fields

§timestamp: u64
§window_id: u32
§win_event: WindowEvent
§

KeyDown

Fields

§timestamp: u64
§window_id: u32
§keycode: Option<Keycode>
§scancode: Option<Scancode>
§keymod: Mod
§repeat: bool
§which: u32
§raw: u16
§

KeyUp

Fields

§timestamp: u64
§window_id: u32
§keycode: Option<Keycode>
§scancode: Option<Scancode>
§keymod: Mod
§repeat: bool
§which: u32
§raw: u16
§

TextEditing

Fields

§timestamp: u64
§window_id: u32
§text: String
§start: i32
§length: i32
§

TextInput

Fields

§timestamp: u64
§window_id: u32
§text: String
§

MouseMotion

Fields

§timestamp: u64
§window_id: u32
§which: u32
§mousestate: MouseState
§xrel: f32
§yrel: f32
§

MouseButtonDown

Fields

§timestamp: u64
§window_id: u32
§which: u32
§mouse_btn: MouseButton
§clicks: u8
§

MouseButtonUp

Fields

§timestamp: u64
§window_id: u32
§which: u32
§mouse_btn: MouseButton
§clicks: u8
§

MouseWheel

Fields

§timestamp: u64
§window_id: u32
§which: u32
§mouse_x: f32
§mouse_y: f32
§

JoyAxisMotion

Fields

§timestamp: u64
§which: u32

The joystick’s id

§axis_idx: u8
§value: i16
§

JoyHatMotion

Fields

§timestamp: u64
§which: u32

The joystick’s id

§hat_idx: u8
§state: HatState
§

JoyButtonDown

Fields

§timestamp: u64
§which: u32

The joystick’s id

§button_idx: u8
§

JoyButtonUp

Fields

§timestamp: u64
§which: u32

The joystick’s id

§button_idx: u8
§

JoyDeviceAdded

Fields

§timestamp: u64
§which: u32

The newly added joystick’s joystick_index

§

JoyDeviceRemoved

Fields

§timestamp: u64
§which: u32

The joystick’s id

§

ControllerAxisMotion

Fields

§timestamp: u64
§which: u32

The controller’s joystick id

§axis: Axis
§value: i16
§

ControllerButtonDown

Fields

§timestamp: u64
§which: u32

The controller’s joystick id

§button: Button
§

ControllerButtonUp

Fields

§timestamp: u64
§which: u32

The controller’s joystick id

§button: Button
§

ControllerDeviceAdded

Fields

§timestamp: u64
§which: u32

The newly added controller’s joystick_index

§

ControllerDeviceRemoved

Fields

§timestamp: u64
§which: u32

The controller’s joystick id

§

ControllerDeviceRemapped

Fields

§timestamp: u64
§which: u32

The controller’s joystick id

§

ControllerTouchpadDown

Fields

§timestamp: u64
§which: u32

The joystick instance id

§touchpad: i32

The index of the touchpad

§finger: i32

The index of the finger on the touchpad

§x: f32

Normalized in the range 0…1 with 0 being on the left

§y: f32

Normalized in the range 0…1 with 0 being at the top

§pressure: f32

Normalized in the range 0…1

§

ControllerTouchpadMotion

Fields

§timestamp: u64
§which: u32

The joystick instance id

§touchpad: i32

The index of the touchpad

§finger: i32

The index of the finger on the touchpad

§x: f32

Normalized in the range 0…1 with 0 being on the left

§y: f32

Normalized in the range 0…1 with 0 being at the top

§pressure: f32

Normalized in the range 0…1

§

ControllerTouchpadUp

Fields

§timestamp: u64
§which: u32

The joystick instance id

§touchpad: i32

The index of the touchpad

§finger: i32

The index of the finger on the touchpad

§x: f32

Normalized in the range 0…1 with 0 being on the left

§y: f32

Normalized in the range 0…1 with 0 being at the top

§pressure: f32

Normalized in the range 0…1

§

FingerDown

Fields

§timestamp: u64
§touch_id: u64
§finger_id: u64
§dx: f32
§dy: f32
§pressure: f32
§

FingerUp

Fields

§timestamp: u64
§touch_id: u64
§finger_id: u64
§dx: f32
§dy: f32
§pressure: f32
§

FingerMotion

Fields

§timestamp: u64
§touch_id: u64
§finger_id: u64
§dx: f32
§dy: f32
§pressure: f32
§

DollarRecord

Fields

§timestamp: u64
§touch_id: i64
§gesture_id: i64
§num_fingers: u32
§error: f32
§

MultiGesture

Fields

§timestamp: u64
§touch_id: i64
§d_theta: f32
§d_dist: f32
§num_fingers: u16
§

ClipboardUpdate

Fields

§timestamp: u64
§

DropFile

Fields

§timestamp: u64
§window_id: u32
§filename: String
§

DropText

Fields

§timestamp: u64
§window_id: u32
§filename: String
§

DropBegin

Fields

§timestamp: u64
§window_id: u32
§

DropComplete

Fields

§timestamp: u64
§window_id: u32
§

AudioDeviceAdded

Fields

§timestamp: u64
§which: u32
§iscapture: bool
§

AudioDeviceRemoved

Fields

§timestamp: u64
§which: u32
§iscapture: bool
§

RenderTargetsReset

Fields

§timestamp: u64
§

RenderDeviceReset

Fields

§timestamp: u64
§

User

Fields

§timestamp: u64
§window_id: u32
§type_: u32
§code: i32
§

Unknown

Fields

§timestamp: u64
§type_: u32
§

Display

Fields

§timestamp: u64
§display: Display
§display_event: DisplayEvent

Implementations§

§

impl Event

pub fn from_ll(raw: SDL_Event) -> Event

pub fn is_user_event(&self) -> bool

pub fn as_user_event_type<T>(&self) -> Option<T>
where T: Any,

pub fn is_same_kind_as(&self, other: &Event) -> bool

Returns true if they are the same “kind” of events.

§Example:
use sdl3::event::Event;

let ev1 = Event::JoyButtonDown {
    timestamp: 0,
    which: 0,
    button_idx: 0,
};
let ev2 = Event::JoyButtonDown {
    timestamp: 1,
    which: 1,
    button_idx: 1,
};

assert!(ev1 != ev2); // The events aren't equal (they contain different values).
assert!(ev1.is_same_kind_as(&ev2)); // But they are of the same kind!

pub fn get_timestamp(&self) -> u64

Returns the timestamp field of the event.

§Example
use sdl3::event::Event;

let ev = Event::JoyButtonDown {
    timestamp: 12,
    which: 0,
    button_idx: 0,
};
assert!(ev.get_timestamp() == 12);

pub fn get_window_id(&self) -> Option<u32>

Returns the window_id field of the event if it’s present (not all events have it!).

§Example
use sdl3::event::Event;

let ev = Event::JoyButtonDown {
    timestamp: 0,
    which: 0,
    button_idx: 0,
};
assert!(ev.get_window_id() == None);

let another_ev = Event::DropBegin {
    timestamp: 0,
    window_id: 3,
};
assert!(another_ev.get_window_id() == Some(3));

pub fn is_window(&self) -> bool

Returns true if this is a window event.

§Example
use sdl3::event::Event;

let ev = Event::Quit {
    timestamp: 0,
};
assert!(ev.is_window());

let ev = Event::AppLowMemory {
    timestamp: 0,
};
assert!(ev.is_window());

let another_ev = Event::TextInput {
    timestamp: 0,
    window_id: 0,
    text: String::new(),
};
assert!(another_ev.is_window() == false); // Not a window event!

pub fn is_keyboard(&self) -> bool

Returns true if this is a keyboard event.

§Example
use sdl3::event::Event;
use sdl3::keyboard::Mod;

let ev = Event::KeyDown {
    timestamp: 0,
    window_id: 0,
    keycode: None,
    scancode: None,
    keymod: Mod::empty(),
    repeat: false,
    which: 0,
    raw: 0,
};
assert!(ev.is_keyboard());

let another_ev = Event::Quit {
    timestamp: 0,
};
assert!(another_ev.is_keyboard() == false); // Not a keyboard event!

pub fn is_text(&self) -> bool

Returns true if this is a text event.

§Example
use sdl3::event::Event;

let ev = Event::TextInput {
    timestamp: 0,
    window_id: 0,
    text: String::new(),
};
assert!(ev.is_text());

let another_ev = Event::Quit {
    timestamp: 0,
};
assert!(another_ev.is_text() == false); // Not a text event!

pub fn is_mouse(&self) -> bool

Returns true if this is a mouse event.

§Example
use sdl3::event::Event;
use sdl3::mouse::MouseWheelDirection;

let ev = Event::MouseWheel {
    timestamp: 0,
    window_id: 0,
    which: 0,
    mouse_x: 0.0,
    mouse_y: 0.0,
    x: 0.0,
    y: 0.0,
    direction: MouseWheelDirection::Normal,
};
assert!(ev.is_mouse());

let another_ev = Event::Quit {
    timestamp: 0,
};
assert!(another_ev.is_mouse() == false); // Not a mouse event!

pub fn is_controller(&self) -> bool

Returns true if this is a controller event.

§Example
use sdl3::event::Event;

let ev = Event::ControllerDeviceAdded {
    timestamp: 0,
    which: 0,
};
assert!(ev.is_controller());

let another_ev = Event::Quit {
    timestamp: 0,
};
assert!(another_ev.is_controller() == false); // Not a controller event!

pub fn is_joy(&self) -> bool

Returns true if this is a joy event.

§Example
use sdl3::event::Event;

let ev = Event::JoyButtonUp {
    timestamp: 0,
    which: 0,
    button_idx: 0,
};
assert!(ev.is_joy());

let another_ev = Event::Quit {
    timestamp: 0,
};
assert!(another_ev.is_joy() == false); // Not a joy event!

pub fn is_finger(&self) -> bool

Returns true if this is a finger event.

§Example
use sdl3::event::Event;

let ev = Event::FingerMotion {
    timestamp: 0,
    touch_id: 0,
    finger_id: 0,
    x: 0.,
    y: 0.,
    dx: 0.,
    dy: 0.,
    pressure: 0.,
};
assert!(ev.is_finger());

let another_ev = Event::Quit {
    timestamp: 0,
};
assert!(another_ev.is_finger() == false); // Not a finger event!

pub fn is_drop(&self) -> bool

Returns true if this is a drop event.

§Example
use sdl3::event::Event;

let ev = Event::DropBegin {
    timestamp: 0,
    window_id: 3,
};
assert!(ev.is_drop());

let another_ev = Event::Quit {
    timestamp: 0,
};
assert!(another_ev.is_drop() == false); // Not a drop event!

pub fn is_audio(&self) -> bool

Returns true if this is an audio event.

§Example
use sdl3::event::Event;

let ev = Event::AudioDeviceAdded {
    timestamp: 0,
    which: 3,
    iscapture: false,
};
assert!(ev.is_audio());

let another_ev = Event::Quit {
    timestamp: 0,
};
assert!(another_ev.is_audio() == false); // Not an audio event!

pub fn is_render(&self) -> bool

Returns true if this is a render event.

§Example
use sdl3::event::Event;

let ev = Event::RenderTargetsReset {
    timestamp: 0,
};
assert!(ev.is_render());

let another_ev = Event::Quit {
    timestamp: 0,
};
assert!(another_ev.is_render() == false); // Not a render event!

pub fn is_user(&self) -> bool

Returns true if this is a user event.

§Example
use sdl3::event::Event;

let ev = Event::User {
    timestamp: 0,
    window_id: 0,
    type_: 0,
    code: 0,
    data1: ::std::ptr::null_mut(),
    data2: ::std::ptr::null_mut(),
};
assert!(ev.is_user());

let another_ev = Event::Quit {
    timestamp: 0,
};
assert!(another_ev.is_user() == false); // Not a user event!

pub fn is_unknown(&self) -> bool

Returns true if this is an unknown event.

§Example
use sdl3::event::Event;

let ev = Event::Unknown {
    timestamp: 0,
    type_: 0,
};
assert!(ev.is_unknown());

let another_ev = Event::Quit {
    timestamp: 0,
};
assert!(another_ev.is_unknown() == false); // Not an unknown event!

pub fn get_converted_coords<T>(&self, canvas: &Canvas<T>) -> Option<Event>
where T: RenderTarget,

pub fn convert_coords<T>(&mut self, canvas: &Canvas<T>) -> bool
where T: RenderTarget,

Trait Implementations§

§

impl Clone for Event

§

fn clone(&self) -> Event

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Event

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl PartialEq for Event

§

fn eq(&self, other: &Event) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl Send for Event

This does not auto-derive because User’s data fields can be used to store pointers to types that are !Send. Dereferencing these as pointers requires using unsafe and ensuring your own safety guarantees.

§

impl StructuralPartialEq for Event

§

impl Sync for Event

This does not auto-derive because User’s data fields can be used to store pointers to types that are !Sync. Dereferencing these as pointers requires using unsafe and ensuring your own safety guarantees.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ByteSized for T

Source§

const BYTE_ALIGN: usize = _

The alignment of this type in bytes.
Source§

const BYTE_SIZE: usize = _

The size of this type in bytes.
Source§

fn byte_align(&self) -> usize

Returns the alignment of this type in bytes.
Source§

fn byte_size(&self) -> usize

Returns the size of this type in bytes. Read more
Source§

fn ptr_size_ratio(&self) -> [usize; 2]

Returns the size ratio between Ptr::BYTES and BYTE_SIZE. Read more
Source§

impl<T, R> Chain<R> for T
where T: ?Sized,

Source§

fn chain<F>(self, f: F) -> R
where F: FnOnce(Self) -> R, Self: Sized,

Chain a function which takes the parameter by value.
Source§

fn chain_ref<F>(&self, f: F) -> R
where F: FnOnce(&Self) -> R,

Chain a function which takes the parameter by shared reference.
Source§

fn chain_mut<F>(&mut self, f: F) -> R
where F: FnOnce(&mut Self) -> R,

Chain a function which takes the parameter by exclusive reference.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> ExtAny for T
where T: Any + ?Sized,

Source§

fn type_id() -> TypeId

Returns the TypeId of Self. Read more
Source§

fn type_of(&self) -> TypeId

Returns the TypeId of self. Read more
Source§

fn type_name(&self) -> &'static str

Returns the type name of self. Read more
Source§

fn type_is<T: 'static>(&self) -> bool

Returns true if Self is of type T. Read more
Source§

fn type_hash(&self) -> u64

Returns a deterministic hash of the TypeId of Self.
Source§

fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64

Returns a deterministic hash of the TypeId of Self using a custom hasher.
Source§

fn as_any_ref(&self) -> &dyn Any
where Self: Sized,

Upcasts &self as &dyn Any. Read more
Source§

fn as_any_mut(&mut self) -> &mut dyn Any
where Self: Sized,

Upcasts &mut self as &mut dyn Any. Read more
Source§

fn as_any_box(self: Box<Self>) -> Box<dyn Any>
where Self: Sized,

Upcasts Box<self> as Box<dyn Any>. Read more
Source§

fn downcast_ref<T: 'static>(&self) -> Option<&T>

Available on crate feature unsafe_layout only.
Returns some shared reference to the inner value if it is of type T. Read more
Source§

fn downcast_mut<T: 'static>(&mut self) -> Option<&mut T>

Available on crate feature unsafe_layout only.
Returns some exclusive reference to the inner value if it is of type T. Read more
Source§

impl<T> ExtMem for T
where T: ?Sized,

Source§

const NEEDS_DROP: bool = _

Know whether dropping values of this type matters, in compile-time.
Source§

fn mem_align_of<T>() -> usize

Returns the minimum alignment of the type in bytes. Read more
Source§

fn mem_align_of_val(&self) -> usize

Returns the alignment of the pointed-to value in bytes. Read more
Source§

fn mem_size_of<T>() -> usize

Returns the size of a type in bytes. Read more
Source§

fn mem_size_of_val(&self) -> usize

Returns the size of the pointed-to value in bytes. Read more
Source§

fn mem_copy(&self) -> Self
where Self: Copy,

Bitwise-copies a value. Read more
Source§

fn mem_needs_drop(&self) -> bool

Returns true if dropping values of this type matters. Read more
Source§

fn mem_drop(self)
where Self: Sized,

Drops self by running its destructor. Read more
Source§

fn mem_forget(self)
where Self: Sized,

Forgets about self without running its destructor. Read more
Source§

fn mem_replace(&mut self, other: Self) -> Self
where Self: Sized,

Replaces self with other, returning the previous value of self. Read more
Source§

fn mem_take(&mut self) -> Self
where Self: Default,

Replaces self with its default value, returning the previous value of self. Read more
Source§

fn mem_swap(&mut self, other: &mut Self)
where Self: Sized,

Swaps the value of self and other without deinitializing either one. Read more
Source§

unsafe fn mem_zeroed<T>() -> T

Available on crate feature unsafe_layout only.
Returns the value of type T represented by the all-zero byte-pattern. Read more
Source§

unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst

Available on crate feature unsafe_layout only.
Returns the value of type T represented by the all-zero byte-pattern. Read more
Source§

fn mem_as_bytes(&self) -> &[u8]
where Self: Sync + Unpin,

Available on crate feature unsafe_slice only.
View a Sync + Unpin self as &[u8]. Read more
Source§

fn mem_as_bytes_mut(&mut self) -> &mut [u8]
where Self: Sync + Unpin,

Available on crate feature unsafe_slice only.
View a Sync + Unpin self as &mut [u8]. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

Source§

impl<T> Hook for T

Source§

fn hook_ref<F>(self, f: F) -> Self
where F: FnOnce(&Self),

Applies a function which takes the parameter by shared reference, and then returns the (possibly) modified owned value. Read more
Source§

fn hook_mut<F>(self, f: F) -> Self
where F: FnOnce(&mut Self),

Applies a function which takes the parameter by exclusive reference, and then returns the (possibly) modified owned value. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

§

fn into_sample(self) -> T

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

§

impl<T> Ungil for T
where T: Send,