Trait openraft::TryAsRef

source ·
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§

source

fn try_as_ref(&self) -> Option<&T>

Try to convert this type into a shared reference of T.

Implementors§

source§

impl<NID, N> TryAsRef<ForwardToLeader<NID, N>> for CheckIsLeaderError<NID, N>
where NID: NodeId, N: Node,

source§

impl<NID, N> TryAsRef<ForwardToLeader<NID, N>> for ClientWriteError<NID, N>
where NID: NodeId, N: Node,

source§

impl<NID, N, E> TryAsRef<ForwardToLeader<NID, N>> for RaftError<NID, E>
where NID: NodeId, N: Node, E: Debug + TryAsRef<ForwardToLeader<NID, N>>,