pub struct MemoryStorage { /* private fields */ }Expand description
In-memory storage adapter backed by HashMap<String, Children>.
See the module docs for semantics.
Implementations§
Source§impl MemoryStorage
impl MemoryStorage
Trait Implementations§
Source§impl Actor for MemoryStorage
impl Actor for MemoryStorage
Source§fn try_clone_storage(&self) -> Option<Box<dyn Actor>>
fn try_clone_storage(&self) -> Option<Box<dyn Actor>>
MemoryStorage does not split into read/write actors.
In-memory writes are synchronous (no fsync), so there is no benefit to splitting reads from writes. Keeping a single actor preserves read-after-write ordering for tests and synchronous use cases.
Source§fn pre_start<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_ctx: &'life1 ActorContext,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn pre_start<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_ctx: &'life1 ActorContext,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Called once before the actor starts processing messages. Read more
Source§fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
message: Arc<Message>,
ctx: &'life1 ActorContext,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
message: Arc<Message>,
ctx: &'life1 ActorContext,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Handle an incoming message. Read more
Source§fn handle_batch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
batch: &'life1 mut Vec<Arc<Message>>,
context: &'life2 ActorContext,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn handle_batch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
batch: &'life1 mut Vec<Arc<Message>>,
context: &'life2 ActorContext,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Handle a batch of messages drained from the mailbox. Read more
Source§fn stopping<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_context: &'life1 ActorContext,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn stopping<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_context: &'life1 ActorContext,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Called once after the actor’s message loop exits. Read more
Source§fn subscribe_to_everything(&self) -> bool
fn subscribe_to_everything(&self) -> bool
Whether this actor wants to receive all messages (not just addressed
to it). Used by the Multicast adapter. Read more
Source§fn is_relay_server(&self) -> bool
fn is_relay_server(&self) -> bool
Whether this actor is a relay server (WsServer) that accepts
incoming WebSocket connections and fans out to individual WsConn
clients. Read more
Source§impl Clone for MemoryStorage
impl Clone for MemoryStorage
Source§fn clone(&self) -> MemoryStorage
fn clone(&self) -> MemoryStorage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 !RefUnwindSafe for MemoryStorage
impl !UnwindSafe for MemoryStorage
impl Freeze for MemoryStorage
impl Send for MemoryStorage
impl Sync for MemoryStorage
impl Unpin for MemoryStorage
impl UnsafeUnpin for MemoryStorage
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