pub enum DispatchData {
Lazy(Box<dyn Serialisable>, ActorPath, ActorPath),
Serialised(SerialisedFrame),
NetMessage(NetMessage),
}Expand description
An abstraction over lazy or eagerly serialised data sent to the dispatcher
Variants§
Lazy(Box<dyn Serialisable>, ActorPath, ActorPath)
Lazily serialised variant – must still be serialised by the dispatcher or networking system (Serialisable Msg, Source, Destination)
Serialised(SerialisedFrame)
Should be serialised and framed.
NetMessage(NetMessage)
Used in message forwarding
Implementations§
Source§impl DispatchData
impl DispatchData
Sourcepub fn into_local(self) -> Result<NetMessage, SerError>
pub fn into_local(self) -> Result<NetMessage, SerError>
Try to extract a network message from this data for local delivery
This can fail, if the data can’t be moved onto the heap, and serialisation also fails.
Sourcepub fn into_serialised(
self,
buf: &mut BufferEncoder<'_>,
) -> Result<SerialisedFrame, SerError>
pub fn into_serialised( self, buf: &mut BufferEncoder<'_>, ) -> Result<SerialisedFrame, SerError>
Try to serialise this to data to bytes for remote delivery
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for DispatchData
impl !RefUnwindSafe for DispatchData
impl Send for DispatchData
impl !Sync for DispatchData
impl Unpin for DispatchData
impl UnsafeUnpin for DispatchData
impl !UnwindSafe for DispatchData
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