Trait call_by::As [−][src]
The generalization of Into
, AsRef
, and AsMut
: in a calling-convention polymorphic
context, this trait allows you to invoke the appropriate conversion method depending on the
applicable calling convention.
Examples
use call_by::*; fn do_something<'a, T, S, C>(input: <S as By<'a, C>>::Type) where T: By<'a, C>, S: By<'a, C> + As<'a, C, T>, C: Convention, { let t: <T as By<'a, C>>::Type = S::as_convention(input); // ... do something with `t` ... }
Required methods
fn as_convention(this: Self::Type) -> <T as By<'a, C>>::Type
[src]
Implementors
impl<'a, T, S> As<'a, Val, T> for S where
S: Into<T>,
[src]
S: Into<T>,
fn as_convention(this: S) -> T
[src]
impl<'a, T: 'a, S: 'a> As<'a, Mut, T> for S where
S: AsMut<T>,
[src]
S: AsMut<T>,
fn as_convention(this: &mut S) -> &mut T
[src]
impl<'a, T: 'a, S: 'a> As<'a, Ref, T> for S where
S: AsRef<T>,
[src]
S: AsRef<T>,