pub struct Actor<Message, State, Response> { /* private fields */ }Implementations§
source§impl<Message: Debug + Send + Sync + 'static, State: Debug + Send + Sync + 'static, Response: Debug + Send + Sync + 'static> Actor<Message, State, Response>
impl<Message: Debug + Send + Sync + 'static, State: Debug + Send + Sync + 'static, Response: Debug + Send + Sync + 'static> Actor<Message, State, Response>
pub async fn new<F>( name: String, handler: F, state: State, buffer: usize ) -> Arc<Self>where F: Fn(Context<Message, State, Response>) -> CallbackFuture<Result<Response, BoxDynError>> + Send + Sync + 'static,
pub async fn callback<F>( &self, msg: Message, handler: F ) -> Result<(), BoxDynError>where F: Fn(Result<Response, BoxDynError>) -> CallbackFuture<Result<(), BoxDynError>> + Send + Sync + 'static,
pub async fn ask(&self, mgs: Message) -> Result<Response, BoxDynError>
pub async fn send(&self, msg: Message) -> Result<(), BoxDynError>
pub async fn state(&self) -> Result<Arc<Mutex<State>>, BoxDynError>
pub async fn stop(&self)
Trait Implementations§
Auto Trait Implementations§
impl<Message, State, Response> !RefUnwindSafe for Actor<Message, State, Response>
impl<Message, State, Response> Send for Actor<Message, State, Response>where Message: Send, Response: Send, State: Send,
impl<Message, State, Response> Sync for Actor<Message, State, Response>where Message: Send, Response: Send, State: Send,
impl<Message, State, Response> Unpin for Actor<Message, State, Response>
impl<Message, State, Response> !UnwindSafe for Actor<Message, State, Response>
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