Struct simrs::State

source · []
pub struct State { /* private fields */ }
Expand description

State of a simulation holding all queues and arbitrary values in a store value.

Implementations

Inserts an arbitrary value to the value store. Learn more in the documentation for Key.

Removes a value of type V from the value store. Learn more in the documentation for Key.

Gets a immutable reference to a value of a type V from the value store. Learn more in the documentation for Key.

Gets a mutable reference to a value of a type V from the value store. Learn more in the documentation for Key.

Creates a new unbounded queue, returning its ID.

Sends value to the queue. This is a shorthand for queue_mut(queue).push(value).

Errors

It returns an error if the queue is full.

Pops the first value from the queue. It returns None if the queue is empty. This is a shorthand for queue_mut(queue).pop(value).

Checks the number of elements in the queue. This is a shorthand for queue(queue).len().

Returns a immutable reference to the queue by the given ID.

Returns a mutable reference to the queue by the given ID.

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.