Trait variadics::VariadicExt
source · pub trait VariadicExt: Variadic + Sealed {
type Extend<Suffix>: VariadicExt
where Suffix: VariadicExt;
type Reverse: VariadicExt;
type AsRefVar<'a>: RefVariadic<UnRefVar = Self, RefVar = Self::AsRefVar<'a>, MutVar = Self::AsMutVar<'a>>
where Self: 'a;
type AsMutVar<'a>: MutVariadic<UnRefVar = Self, RefVar = Self::AsRefVar<'a>, MutVar = Self::AsMutVar<'a>>
where Self: 'a;
type IterAnyRef<'a>: Iterator<Item = &'a dyn Any>
where Self: 'static;
type IterAnyMut<'a>: Iterator<Item = &'a mut dyn Any>
where Self: 'static;
type IntoOption;
type IntoVec: VecVariadic<UnVec = Self> + Default;
const LEN: usize;
// Required methods
fn extend<Suffix>(self, suffix: Suffix) -> Self::Extend<Suffix>
where Suffix: VariadicExt;
fn reverse(self) -> Self::Reverse;
fn reverse_ref(
this: Self::AsRefVar<'_>,
) -> <Self::Reverse as VariadicExt>::AsRefVar<'_>;
fn as_ref_var(&self) -> Self::AsRefVar<'_>;
fn as_mut_var(&mut self) -> Self::AsMutVar<'_>;
fn iter_any_ref(&self) -> Self::IterAnyRef<'_>
where Self: 'static;
fn iter_any_mut(&mut self) -> Self::IterAnyMut<'_>
where Self: 'static;
fn into_option(self) -> Self::IntoOption;
fn into_singleton_vec(self) -> Self::IntoVec;
// Provided methods
fn len(&self) -> usize { ... }
fn is_empty(&self) -> bool { ... }
}
Expand description
Extension methods/types for Variadic
s.
This is a sealed trait.
Required Associated Types§
sourcetype Extend<Suffix>: VariadicExt
where
Suffix: VariadicExt
type Extend<Suffix>: VariadicExt where Suffix: VariadicExt
Creates a new (longer) variadic type by appending Suffix
onto the end of this variadc.
sourcetype Reverse: VariadicExt
type Reverse: VariadicExt
The reverse of this variadic type.
sourcetype AsRefVar<'a>: RefVariadic<UnRefVar = Self, RefVar = Self::AsRefVar<'a>, MutVar = Self::AsMutVar<'a>>
where
Self: 'a
type AsRefVar<'a>: RefVariadic<UnRefVar = Self, RefVar = Self::AsRefVar<'a>, MutVar = Self::AsMutVar<'a>> where Self: 'a
This as a variadic of references.
sourcetype AsMutVar<'a>: MutVariadic<UnRefVar = Self, RefVar = Self::AsRefVar<'a>, MutVar = Self::AsMutVar<'a>>
where
Self: 'a
type AsMutVar<'a>: MutVariadic<UnRefVar = Self, RefVar = Self::AsRefVar<'a>, MutVar = Self::AsMutVar<'a>> where Self: 'a
This as a variadic of exclusive (mut
) references.
sourcetype IterAnyRef<'a>: Iterator<Item = &'a dyn Any>
where
Self: 'static
type IterAnyRef<'a>: Iterator<Item = &'a dyn Any> where Self: 'static
Iterator type returned by Self::iter_any_ref
.
sourcetype IterAnyMut<'a>: Iterator<Item = &'a mut dyn Any>
where
Self: 'static
type IterAnyMut<'a>: Iterator<Item = &'a mut dyn Any> where Self: 'static
Iterator type returned by Self::iter_any_mut
.
sourcetype IntoOption
type IntoOption
type for all elements of the variadic being wrapped in Option
sourcetype IntoVec: VecVariadic<UnVec = Self> + Default
type IntoVec: VecVariadic<UnVec = Self> + Default
type for all elements of the variadic being wrapped in Vec
Required Associated Constants§
Required Methods§
sourcefn extend<Suffix>(self, suffix: Suffix) -> Self::Extend<Suffix>where
Suffix: VariadicExt,
fn extend<Suffix>(self, suffix: Suffix) -> Self::Extend<Suffix>where
Suffix: VariadicExt,
Extends this variadic value by appending suffix
onto the end.
sourcefn reverse_ref(
this: Self::AsRefVar<'_>,
) -> <Self::Reverse as VariadicExt>::AsRefVar<'_>
fn reverse_ref( this: Self::AsRefVar<'_>, ) -> <Self::Reverse as VariadicExt>::AsRefVar<'_>
Reverses an AsRefVar variadic value
sourcefn as_ref_var(&self) -> Self::AsRefVar<'_>
fn as_ref_var(&self) -> Self::AsRefVar<'_>
Convert a reference to this variadic into a variadic of references.
let as_ref: var_type!(&u32, &String, &bool) =
var_expr!(1_u32, "Hello".to_owned(), false).as_ref_var();
sourcefn as_mut_var(&mut self) -> Self::AsMutVar<'_>
fn as_mut_var(&mut self) -> Self::AsMutVar<'_>
Convert an exclusive (mut
) reference to this variadic into a variadic of exclusive
(mut
) references.
let as_mut: var_type!(&mut u32, &mut String, &mut bool) =
var_expr!(1_u32, "Hello".to_owned(), false).as_mut_var();
sourcefn iter_any_ref(&self) -> Self::IterAnyRef<'_>where
Self: 'static,
fn iter_any_ref(&self) -> Self::IterAnyRef<'_>where
Self: 'static,
Iterate this variadic as &dyn Any
references.
sourcefn iter_any_mut(&mut self) -> Self::IterAnyMut<'_>where
Self: 'static,
fn iter_any_mut(&mut self) -> Self::IterAnyMut<'_>where
Self: 'static,
Iterate this variadic as &mut dyn Any
exclusive references.
sourcefn into_option(self) -> Self::IntoOption
fn into_option(self) -> Self::IntoOption
wrap all elements of the variadic in `Option``
sourcefn into_singleton_vec(self) -> Self::IntoVec
fn into_singleton_vec(self) -> Self::IntoVec
wrap all elements of the variadic in a Vec