Enum Oneof

Source
#[non_exhaustive]
pub enum Oneof<const LEN: usize, _0 = (), _1 = (), _2 = (), _3 = (), _4 = (), _5 = (), _6 = (), _7 = (), _8 = (), _9 = (), _10 = (), _11 = ()> { _0(_0), _1(_1), _2(_2), _3(_3), _4(_4), _5(_5), _6(_6), _7(_7), _8(_8), _9(_9), _10(_10), _11(_11), }
Expand description

A generic, parameterized enum for expressing structured alternatives.

Variants are expected to be contiguous, meaning () (unit types) should only appear at the end.

The first variant (A) is considered the default, implementing Default when A: Default.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

_0(_0)

The 1st variant.

§

_1(_1)

The 2nd variant.

§

_2(_2)

The 3rd variant.

§

_3(_3)

The 4th variant.

§

_4(_4)

The 5th variant.

§

_5(_5)

The 6th variant.

§

_6(_6)

The 7th variant.

§

_7(_7)

The 8th variant.

§

_8(_8)

The 9th variant.

§

_9(_9)

The 10th variant.

§

_10(_10)

The 11th variant.

§

_11(_11)

The 12th variant.

Implementations§

Source§

impl<const LEN: usize, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11> Oneof<LEN, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11>

§Structural methods.

Source

pub const LEN: usize

The number of active (non-() type) variants.

Source

pub const MAX_ARITY: usize = 12usize

The maximum number of generic type parameters in this enum.

Source

pub const fn variant_index(&self) -> usize

Returns the current variant index (0-based).

Source

pub const fn is_variant_index(&self, index: usize) -> bool

Checks whether the current variant is at index (0-based).

Source

pub const fn variant_name(&self) -> &'static str

Returns the current variant name.

Source

pub const fn is_variant_name(&self, name: &str) -> bool

Checks whether the current variant has the given name.

Source§

impl<const LEN: usize, _0: 'static, _1: 'static, _2: 'static, _3: 'static, _4: 'static, _5: 'static, _6: 'static, _7: 'static, _8: 'static, _9: 'static, _10: 'static, _11: 'static> Oneof<LEN, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11>

Source

pub fn first_non_unit() -> Option<&'static str>

Returns the first non-unit variant name, if any.

Source

pub fn validate() -> bool

Validates that inactive () variants only appear at the end, and that LEN equals the number of active variants.

Source§

impl<const LEN: usize, _0: Clone, _1: Clone, _2: Clone, _3: Clone, _4: Clone, _5: Clone, _6: Clone, _7: Clone, _8: Clone, _9: Clone, _10: Clone, _11: Clone> Oneof<LEN, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11>

§Conversion methods.

Source

pub fn into_tuple_options( self, ) -> (Option<_0>, Option<_1>, Option<_2>, Option<_3>, Option<_4>, Option<_5>, Option<_6>, Option<_7>, Option<_8>, Option<_9>, Option<_10>, Option<_11>)

Returns a tuple with Some(value) for the active variant and None elsewhere.

Source

pub fn into_tuple_defaults( self, ) -> (_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11)
where _0: Default, _1: Default, _2: Default, _3: Default, _4: Default, _5: Default, _6: Default, _7: Default, _8: Default, _9: Default, _10: Default, _11: Default,

Returns a tuple with the active variant’s inner value in its corresponding position and Default::default() for all others.

Source§

impl<const LEN: usize, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11> Oneof<LEN, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11>

Source

pub fn as_tuple_ref_options( &self, ) -> (Option<&_0>, Option<&_1>, Option<&_2>, Option<&_3>, Option<&_4>, Option<&_5>, Option<&_6>, Option<&_7>, Option<&_8>, Option<&_9>, Option<&_10>, Option<&_11>)

Returns a tuple with Some(&value) for the active variant and None elsewhere.

Source§

impl<const LEN: usize, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11> Oneof<LEN, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11>

§Variant-specific methods.

Source

pub const fn is_0(&self) -> bool

Returns true if there’s a value in variant _0 (The 1st).

Source

pub fn into_0(self) -> Option<_0>

Returns the owned value in variant _0, if present.

Source

pub fn as_ref_0(&self) -> Option<&_0>

Returns a reference to the inner value in variant _0, if present.

Source

pub fn as_mut_0(&mut self) -> Option<&mut _0>

Returns a reference to the inner value in variant_0, if present.


Source

pub const fn is_1(&self) -> bool

Returns true if there’s a value in variant _1 (The 2nd).

Source

pub fn into_1(self) -> Option<_1>

Returns the owned value in variant _1, if present.

Source

pub fn as_ref_1(&self) -> Option<&_1>

Returns a reference to the inner value in variant _1, if present.

Source

pub fn as_mut_1(&mut self) -> Option<&mut _1>

Returns a reference to the inner value in variant_1, if present.


Source

pub const fn is_2(&self) -> bool

Returns true if there’s a value in variant _2 (The 3rd).

Source

pub fn into_2(self) -> Option<_2>

Returns the owned value in variant _2, if present.

Source

pub fn as_ref_2(&self) -> Option<&_2>

Returns a reference to the inner value in variant _2, if present.

Source

pub fn as_mut_2(&mut self) -> Option<&mut _2>

Returns a reference to the inner value in variant_2, if present.


Source

pub const fn is_3(&self) -> bool

Returns true if there’s a value in variant _3 (The 4th).

Source

pub fn into_3(self) -> Option<_3>

Returns the owned value in variant _3, if present.

Source

pub fn as_ref_3(&self) -> Option<&_3>

Returns a reference to the inner value in variant _3, if present.

Source

pub fn as_mut_3(&mut self) -> Option<&mut _3>

Returns a reference to the inner value in variant_3, if present.


Source

pub const fn is_4(&self) -> bool

Returns true if there’s a value in variant _4 (The 5th).

Source

pub fn into_4(self) -> Option<_4>

Returns the owned value in variant _4, if present.

Source

pub fn as_ref_4(&self) -> Option<&_4>

Returns a reference to the inner value in variant _4, if present.

Source

pub fn as_mut_4(&mut self) -> Option<&mut _4>

Returns a reference to the inner value in variant_4, if present.


Source

pub const fn is_5(&self) -> bool

Returns true if there’s a value in variant _5 (The 6th).

Source

pub fn into_5(self) -> Option<_5>

Returns the owned value in variant _5, if present.

Source

pub fn as_ref_5(&self) -> Option<&_5>

Returns a reference to the inner value in variant _5, if present.

Source

pub fn as_mut_5(&mut self) -> Option<&mut _5>

Returns a reference to the inner value in variant_5, if present.


Source

pub const fn is_6(&self) -> bool

Returns true if there’s a value in variant _6 (The 7th).

Source

pub fn into_6(self) -> Option<_6>

Returns the owned value in variant _6, if present.

Source

pub fn as_ref_6(&self) -> Option<&_6>

Returns a reference to the inner value in variant _6, if present.

Source

pub fn as_mut_6(&mut self) -> Option<&mut _6>

Returns a reference to the inner value in variant_6, if present.


Source

pub const fn is_7(&self) -> bool

Returns true if there’s a value in variant _7 (The 8th).

Source

pub fn into_7(self) -> Option<_7>

Returns the owned value in variant _7, if present.

Source

pub fn as_ref_7(&self) -> Option<&_7>

Returns a reference to the inner value in variant _7, if present.

Source

pub fn as_mut_7(&mut self) -> Option<&mut _7>

Returns a reference to the inner value in variant_7, if present.


Source

pub const fn is_8(&self) -> bool

Returns true if there’s a value in variant _8 (The 9th).

Source

pub fn into_8(self) -> Option<_8>

Returns the owned value in variant _8, if present.

Source

pub fn as_ref_8(&self) -> Option<&_8>

Returns a reference to the inner value in variant _8, if present.

Source

pub fn as_mut_8(&mut self) -> Option<&mut _8>

Returns a reference to the inner value in variant_8, if present.


Source

pub const fn is_9(&self) -> bool

Returns true if there’s a value in variant _9 (The 10th).

Source

pub fn into_9(self) -> Option<_9>

Returns the owned value in variant _9, if present.

Source

pub fn as_ref_9(&self) -> Option<&_9>

Returns a reference to the inner value in variant _9, if present.

Source

pub fn as_mut_9(&mut self) -> Option<&mut _9>

Returns a reference to the inner value in variant_9, if present.


Source

pub const fn is_10(&self) -> bool

Returns true if there’s a value in variant _10 (The 11th).

Source

pub fn into_10(self) -> Option<_10>

Returns the owned value in variant _10, if present.

Source

pub fn as_ref_10(&self) -> Option<&_10>

Returns a reference to the inner value in variant _10, if present.

Source

pub fn as_mut_10(&mut self) -> Option<&mut _10>

Returns a reference to the inner value in variant_10, if present.


Source

pub const fn is_11(&self) -> bool

Returns true if there’s a value in variant _11 (The 12th).

Source

pub fn into_11(self) -> Option<_11>

Returns the owned value in variant _11, if present.

Source

pub fn as_ref_11(&self) -> Option<&_11>

Returns a reference to the inner value in variant _11, if present.

Source

pub fn as_mut_11(&mut self) -> Option<&mut _11>

Returns a reference to the inner value in variant_11, if present.


Source

pub fn map_0<NEW>( self, f: impl FnOnce(_0) -> NEW, ) -> Oneof<LEN, NEW, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11>

Transforms the inner value in variant_0 using f, leaving other variants unchanged.

Source

pub fn map_1<NEW>( self, f: impl FnOnce(_1) -> NEW, ) -> Oneof<LEN, _0, NEW, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11>

Transforms the inner value in variant_1 using f, leaving other variants unchanged.

Source

pub fn map_2<NEW>( self, f: impl FnOnce(_2) -> NEW, ) -> Oneof<LEN, _0, _1, NEW, _3, _4, _5, _6, _7, _8, _9, _10, _11>

Transforms the inner value in variant_2 using f, leaving other variants unchanged.

Source

pub fn map_3<NEW>( self, f: impl FnOnce(_3) -> NEW, ) -> Oneof<LEN, _0, _1, _2, NEW, _4, _5, _6, _7, _8, _9, _10, _11>

Transforms the inner value in variant_3 using f, leaving other variants unchanged.

Source

pub fn map_4<NEW>( self, f: impl FnOnce(_4) -> NEW, ) -> Oneof<LEN, _0, _1, _2, _3, NEW, _5, _6, _7, _8, _9, _10, _11>

Transforms the inner value in variant_4 using f, leaving other variants unchanged.

Source

pub fn map_5<NEW>( self, f: impl FnOnce(_5) -> NEW, ) -> Oneof<LEN, _0, _1, _2, _3, _4, NEW, _6, _7, _8, _9, _10, _11>

Transforms the inner value in variant_5 using f, leaving other variants unchanged.

Source

pub fn map_6<NEW>( self, f: impl FnOnce(_6) -> NEW, ) -> Oneof<LEN, _0, _1, _2, _3, _4, _5, NEW, _7, _8, _9, _10, _11>

Transforms the inner value in variant_6 using f, leaving other variants unchanged.

Source

pub fn map_7<NEW>( self, f: impl FnOnce(_7) -> NEW, ) -> Oneof<LEN, _0, _1, _2, _3, _4, _5, _6, NEW, _8, _9, _10, _11>

Transforms the inner value in variant_7 using f, leaving other variants unchanged.

Source

pub fn map_8<NEW>( self, f: impl FnOnce(_8) -> NEW, ) -> Oneof<LEN, _0, _1, _2, _3, _4, _5, _6, _7, NEW, _9, _10, _11>

Transforms the inner value in variant_8 using f, leaving other variants unchanged.

Source

pub fn map_9<NEW>( self, f: impl FnOnce(_9) -> NEW, ) -> Oneof<LEN, _0, _1, _2, _3, _4, _5, _6, _7, _8, NEW, _10, _11>

Transforms the inner value in variant_9 using f, leaving other variants unchanged.

Source

pub fn map_10<NEW>( self, f: impl FnOnce(_10) -> NEW, ) -> Oneof<LEN, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, NEW, _11>

Transforms the inner value in variant_10 using f, leaving other variants unchanged.

Source

pub fn map_11<NEW>( self, f: impl FnOnce(_11) -> NEW, ) -> Oneof<LEN, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, NEW>

Transforms the inner value in variant_11 using f, leaving other variants unchanged.

Trait Implementations§

Source§

impl<const LEN: usize, _0: Clone, _1: Clone, _2: Clone, _3: Clone, _4: Clone, _5: Clone, _6: Clone, _7: Clone, _8: Clone, _9: Clone, _10: Clone, _11: Clone> Clone for Oneof<LEN, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11>

Source§

fn clone(&self) -> Oneof<LEN, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11>

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

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

Performs copy-assignment from source. Read more
Source§

impl<const LEN: usize, _0: ConstDefault, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11> ConstDefault for Oneof<LEN, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11>

Source§

const DEFAULT: Self

Returns the compile-time “default value” for a type.
Source§

impl<const LEN: usize, _0: Debug, _1: Debug, _2: Debug, _3: Debug, _4: Debug, _5: Debug, _6: Debug, _7: Debug, _8: Debug, _9: Debug, _10: Debug, _11: Debug> Debug for Oneof<LEN, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<const LEN: usize, _0: Default, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11> Default for Oneof<LEN, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<const LEN: usize, _0: Hash, _1: Hash, _2: Hash, _3: Hash, _4: Hash, _5: Hash, _6: Hash, _7: Hash, _8: Hash, _9: Hash, _10: Hash, _11: Hash> Hash for Oneof<LEN, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<const LEN: usize, _0: PartialEq, _1: PartialEq, _2: PartialEq, _3: PartialEq, _4: PartialEq, _5: PartialEq, _6: PartialEq, _7: PartialEq, _8: PartialEq, _9: PartialEq, _10: PartialEq, _11: PartialEq> PartialEq for Oneof<LEN, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11>

Source§

fn eq( &self, other: &Oneof<LEN, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11>, ) -> 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.
Source§

impl<const LEN: usize, _0: Copy, _1: Copy, _2: Copy, _3: Copy, _4: Copy, _5: Copy, _6: Copy, _7: Copy, _8: Copy, _9: Copy, _10: Copy, _11: Copy> Copy for Oneof<LEN, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11>

Source§

impl<const LEN: usize, _0: Eq, _1: Eq, _2: Eq, _3: Eq, _4: Eq, _5: Eq, _6: Eq, _7: Eq, _8: Eq, _9: Eq, _10: Eq, _11: Eq> Eq for Oneof<LEN, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11>

Source§

impl<const LEN: usize, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11> StructuralPartialEq for Oneof<LEN, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11>

Auto Trait Implementations§

§

impl<const LEN: usize, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11> Freeze for Oneof<LEN, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11>
where _0: Freeze, _1: Freeze, _2: Freeze, _3: Freeze, _4: Freeze, _5: Freeze, _6: Freeze, _7: Freeze, _8: Freeze, _9: Freeze, _10: Freeze, _11: Freeze,

§

impl<const LEN: usize, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11> RefUnwindSafe for Oneof<LEN, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11>

§

impl<const LEN: usize, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11> Send for Oneof<LEN, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11>
where _0: Send, _1: Send, _2: Send, _3: Send, _4: Send, _5: Send, _6: Send, _7: Send, _8: Send, _9: Send, _10: Send, _11: Send,

§

impl<const LEN: usize, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11> Sync for Oneof<LEN, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11>
where _0: Sync, _1: Sync, _2: Sync, _3: Sync, _4: Sync, _5: Sync, _6: Sync, _7: Sync, _8: Sync, _9: Sync, _10: Sync, _11: Sync,

§

impl<const LEN: usize, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11> Unpin for Oneof<LEN, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11>
where _0: Unpin, _1: Unpin, _2: Unpin, _3: Unpin, _4: Unpin, _5: Unpin, _6: Unpin, _7: Unpin, _8: Unpin, _9: Unpin, _10: Unpin, _11: Unpin,

§

impl<const LEN: usize, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11> UnwindSafe for Oneof<LEN, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11>

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, dest: *mut u8)

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

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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
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<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

§

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