[−][src]Struct simrs::State
State of a simulation holding all queues and arbitrary values in a store value.
Implementations
impl State
[src]
#[must_use = "Discarding key results in leaking inserted value"]pub fn insert<V: 'static>(&mut self, value: V) -> Key<V>
[src]
Inserts an arbitrary value to the value store. Learn more in the documentation for Key
.
pub fn remove<V: 'static>(&mut self, key: Key<V>) -> Option<V>
[src]
Removes a value of type V
from the value store. Learn more in the documentation for Key
.
#[must_use]pub fn get<V: 'static>(&self, key: Key<V>) -> Option<&V>
[src]
Gets a immutable reference to a value of a type V
from the value store.
Learn more in the documentation for Key
.
#[must_use]pub fn get_mut<V: 'static>(&mut self, key: Key<V>) -> Option<&mut V>
[src]
Gets a mutable reference to a value of a type V
from the value store.
Learn more in the documentation for Key
.
pub fn new_queue<V: 'static>(&mut self) -> QueueId<V>
[src]
Creates a new unbounded queue, returning its ID.
pub fn new_bounded_queue<V: 'static>(&mut self, capacity: usize) -> QueueId<V>
[src]
Creates a new bounded queue, returning its ID.
pub fn send<V: 'static>(
&mut self,
queue: QueueId<V>,
value: V
) -> Result<(), ()>
[src]
&mut self,
queue: QueueId<V>,
value: V
) -> Result<(), ()>
pub fn recv<V: 'static>(&mut self, queue: QueueId<V>) -> Option<V>
[src]
Pops the first value from the queue
. It returns None
if the queue is empty.
pub fn len<V: 'static>(&mut self, queue: QueueId<V>) -> usize
[src]
Checks the number of elements in the queue.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for State
impl !Send for State
impl !Sync for State
impl Unpin for State
impl !UnwindSafe for State
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,