pub trait TryAsRef<T> {
// Required method
fn try_as_ref(&self) -> Option<&T>;
}
Expand description
Similar to AsRef<T>
, it does a cheap reference to reference conversion, but with the ability
to return None
if it is unable to perform the conversion to &T
.
Required Methods§
sourcefn try_as_ref(&self) -> Option<&T>
fn try_as_ref(&self) -> Option<&T>
Try to convert this type into a shared reference of T
.