pub trait TryAsRef<T> {
// Required method
fn try_as_ref(&self) -> Option<&T>;
}Expand description
This trait allows for attempting to a cheap reference-to-reference conversion.
Required Methods§
Sourcefn try_as_ref(&self) -> Option<&T>
fn try_as_ref(&self) -> Option<&T>
Attempts to convert self to a reference to T.
If it is not possible, this method will return None.