pub struct AnyMessageRef<'a> { /* private fields */ }Expand description
A reference to the message inside Envelope or AnyMessage.
Implementations§
Source§impl<'a> AnyMessageRef<'a>
impl<'a> AnyMessageRef<'a>
pub fn downcast_ref<M: Message>(&self) -> Option<&'a M>
Methods from Deref<Target = AnyMessage>§
Sourcepub fn as_ref(&self) -> AnyMessageRef<'_>
pub fn as_ref(&self) -> AnyMessageRef<'_>
Returns AnyMessageRef that borrows the message.
Sourcepub fn is<M: Message>(&self) -> bool
pub fn is<M: Message>(&self) -> bool
Checks if the message is of a specific type.
Note: it returns true if M is AnyMessage.
Sourcepub fn downcast_ref<M: Message>(&self) -> Option<&M>
pub fn downcast_ref<M: Message>(&self) -> Option<&M>
Tries to downcast the message to a reference to the concrete type.
Note: it returns Some(&self) if M is AnyMessage.
Trait Implementations§
Source§impl Debug for AnyMessageRef<'_>
impl Debug for AnyMessageRef<'_>
Source§impl Deref for AnyMessageRef<'_>
impl Deref for AnyMessageRef<'_>
Auto Trait Implementations§
impl<'a> Freeze for AnyMessageRef<'a>
impl<'a> RefUnwindSafe for AnyMessageRef<'a>
impl<'a> !Send for AnyMessageRef<'a>
impl<'a> !Sync for AnyMessageRef<'a>
impl<'a> Unpin for AnyMessageRef<'a>
impl<'a> UnsafeUnpin for AnyMessageRef<'a>
impl<'a> UnwindSafe for AnyMessageRef<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more