pub struct EncodeContext { /* private fields */ }Expand description
Context passed through every Encode::encode call.
Carries the remote actor registry so that when the address of an actor which can be reached over IPC is serialized for the first time, it can self-register in the registry.
Implementations§
Source§impl EncodeContext
impl EncodeContext
Sourcepub fn new(registry: RemoteActorRegistry) -> Self
pub fn new(registry: RemoteActorRegistry) -> Self
Constructs a new EncodeContext from the given actor registry.
Sourcepub fn create_decode_context(&self, session: Address<Session>) -> DecodeContext
pub fn create_decode_context(&self, session: Address<Session>) -> DecodeContext
Creates a new DecodeContext from this context and the given remote session.
Sourcepub fn register<A>(&self, address: &A) -> Result<(), EncodeError>where
A: SenderId + ToRemoteMessageRecipient,
pub fn register<A>(&self, address: &A) -> Result<(), EncodeError>where
A: SenderId + ToRemoteMessageRecipient,
Registers the given address/recipient in the actor registry.
Trait Implementations§
Source§impl Clone for EncodeContext
impl Clone for EncodeContext
Source§fn clone(&self) -> EncodeContext
fn clone(&self) -> EncodeContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EncodeContext
impl !RefUnwindSafe for EncodeContext
impl Send for EncodeContext
impl Sync for EncodeContext
impl Unpin for EncodeContext
impl UnsafeUnpin for EncodeContext
impl !UnwindSafe for EncodeContext
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