pub struct Actor<T>{
pub sender: ActorSender<T>,
pub receiver: Receiver<T>,
pub handle: JoinHandle<ActorResult<()>>,
pub name: Option<String>,
}Fields§
§sender: ActorSender<T>§receiver: Receiver<T>§handle: JoinHandle<ActorResult<()>>§name: Option<String>Implementations§
Source§impl<T> Actor<T>
impl<T> Actor<T>
Sourcepub fn new(
sender: ActorSender<T>,
receiver: Receiver<T>,
handle: JoinHandle<ActorResult<()>>,
name: Option<String>,
) -> Self
pub fn new( sender: ActorSender<T>, receiver: Receiver<T>, handle: JoinHandle<ActorResult<()>>, name: Option<String>, ) -> Self
Create a new actor handler struct.
pub fn cast(&self, message: T) -> ActorResult<()>
pub fn call(&self, message: T) -> ActorResult<T>
Auto Trait Implementations§
impl<T> Freeze for Actor<T>
impl<T> !RefUnwindSafe for Actor<T>
impl<T> Send for Actor<T>
impl<T> !Sync for Actor<T>
impl<T> Unpin for Actor<T>
impl<T> !UnwindSafe for Actor<T>
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