stun_codec/
convert.rs

1//! Conversion traits.
2
3/// This trait allows for attempting to a cheap reference-to-reference conversion.
4pub trait TryAsRef<T> {
5    /// Attempts to convert `self` to a reference to `T`.
6    ///
7    /// If it is not possible, this method will return `None`.
8    fn try_as_ref(&self) -> Option<&T>;
9}