Struct asynchronix::simulation::Mailbox
source · pub struct Mailbox<M: Model>(_);
Expand description
A model mailbox.
A mailbox is an entity associated to a model instance that collects all
messages sent to that model. The size of its internal buffer can be
optionally specified at construction time using
with_capacity
.
Implementations§
source§impl<M: Model> Mailbox<M>
impl<M: Model> Mailbox<M>
sourcepub const DEFAULT_CAPACITY: usize = 16usize
pub const DEFAULT_CAPACITY: usize = 16usize
Default capacity when created with new
or Default::default
.
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates a new mailbox with the specified capacity.
Panic
The constructor will panic if the requested capacity is 0 or is greater
than usize::MAX/2 + 1
.
Trait Implementations§
Auto Trait Implementations§
impl<M> !RefUnwindSafe for Mailbox<M>
impl<M> Send for Mailbox<M>
impl<M> Sync for Mailbox<M>
impl<M> Unpin for Mailbox<M>
impl<M> !UnwindSafe for Mailbox<M>
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