Function call_by::from_ref [−][src]
pub fn from_ref<'a, T: By<'a, Ref>>(by_ref: &'a T) -> T::Type
Safe, zero-cost cast from &'a T
to <T as By<'a, Ref>>::Type
.
Rust’s type system does not always know that &'a T
is <T as By<'a, Ref>>::Type
for all 'a
.
This function safely converts from the former to the latter.