pub struct Session { /* private fields */ }Expand description
An actor which manages the IPC connection to a remote endpoint.
Trait Implementations§
Source§impl Actor for Session
impl Actor for Session
Source§type Error = SessionError
type Error = SessionError
The error type returned by lifecycle hooks and message handlers.
Source§async fn post_start(
&mut self,
ctx: &mut Self::Context,
) -> Result<(), SessionError>
async fn post_start( &mut self, ctx: &mut Self::Context, ) -> Result<(), SessionError>
Source§fn stopping(
&mut self,
ctx: &mut Self::Context,
) -> impl Future<Output = Result<Stopping, Self::Error>> + Send
fn stopping( &mut self, ctx: &mut Self::Context, ) -> impl Future<Output = Result<Stopping, Self::Error>> + Send
Source§fn run<S>(
self,
label: S,
) -> Result<(Address<Self>, JoinHandle<()>), Self::Error>
fn run<S>( self, label: S, ) -> Result<(Address<Self>, JoinHandle<()>), Self::Error>
Starts an actor and spawns it to the tokio runtime, returns its actor address and the
join handle.
Source§fn create<S, F>(
label: S,
f: F,
) -> Result<(Address<Self>, JoinHandle<()>), Self::Error>
fn create<S, F>( label: S, f: F, ) -> Result<(Address<Self>, JoinHandle<()>), Self::Error>
Creates a new actor, starts it and spawns it to the tokio runtime, returns its actor
address and the join handle.
Source§fn create_in_span<S, F>(
label: S,
parent_span: Option<&Span>,
f: F,
) -> Result<(Address<Self>, JoinHandle<()>), Self::Error>
fn create_in_span<S, F>( label: S, parent_span: Option<&Span>, f: F, ) -> Result<(Address<Self>, JoinHandle<()>), Self::Error>
Source§fn type_erased_recipient_fn() -> Option<fn(&Address<Self>) -> TypeErasedRecipient>
fn type_erased_recipient_fn() -> Option<fn(&Address<Self>) -> TypeErasedRecipient>
Available on crate feature
type-erased-recipient-hook only.Opt-in hook that turns an
Address<A> into a type-erased trait object which can be
downcast into a concrete Recipient<M>, where M is a specific message type
chosen in the overridden implementation of this method. Read moreSource§impl Handler<CreateRemoteActor> for Session
impl Handler<CreateRemoteActor> for Session
Source§type Result = FutureMessageResult<CreateRemoteActor>
type Result = FutureMessageResult<CreateRemoteActor>
The return type of the handler, which must implement
MessageResponse.Source§impl Handler<GetRemoteActor> for Session
impl Handler<GetRemoteActor> for Session
Source§type Result = FutureMessageResult<GetRemoteActor>
type Result = FutureMessageResult<GetRemoteActor>
The return type of the handler, which must implement
MessageResponse.Auto Trait Implementations§
impl Freeze for Session
impl !RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl !UnwindSafe for Session
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