pub struct Actor<I> { /* private fields */ }
Expand description
Actor Model Ensure Thread safety and high performance writing
Implementations§
source§impl<I: 'static> Actor<I>
impl<I: 'static> Actor<I>
pub fn new(x: I) -> Actor<I>
sourcepub async fn inner_call<T, R>(
&self,
call: impl FnOnce(Arc<InnerStore<I>>) -> T
) -> Rwhere
T: Future<Output = R>,
pub async fn inner_call<T, R>( &self, call: impl FnOnce(Arc<InnerStore<I>>) -> T ) -> Rwhere T: Future<Output = R>,
Behavior through queues,thread safe call async fn
sourcepub unsafe fn deref_inner(&self) -> RefInner<'_, I>
pub unsafe fn deref_inner(&self) -> RefInner<'_, I>
Safety
This is a thread unsafe way to get When using, please make sure there is no thread safety problem
Trait Implementations§
Auto Trait Implementations§
impl<I> !RefUnwindSafe for Actor<I>
impl<I> Send for Actor<I>
impl<I> Sync for Actor<I>
impl<I> Unpin for Actor<I>
impl<I> !UnwindSafe for Actor<I>
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