Function call_by::to_ref[][src]

pub fn to_ref<'a, T: By<'a, Ref>>(by_ref: T::Type) -> &'a T

Safe, zero-cost cast from <T as By<'a, Ref>>::Type to &'a T.

Rust’s type system does not always know that <T as By<'a, Ref>>::Type is &'a T for all 'a. This function safely converts from the former to the latter.