Struct Configuration

Source
pub struct Configuration<StateId: IndexLike, MessageId: IndexLike, InvalidId: IndexLike, const MAX_AGENTS: usize, const MAX_MESSAGES: usize> {
    pub state_ids: [StateId; MAX_AGENTS],
    pub message_counts: [MessageIndex; MAX_AGENTS],
    pub message_ids: [MessageId; MAX_MESSAGES],
    pub invalid_id: InvalidId,
}
Expand description

A complete system configuration.

We will have a lot of these, so keeping their size down and avoiding heap memory as much as possible is critical. The maximal sizes were chosen so that the configuration plus its memoized identifier will fit together inside exactly one cache lines, which should make this more cache-friendly when placed inside a hash table.

Fields§

§state_ids: [StateId; MAX_AGENTS]

The state of each agent.

§message_counts: [MessageIndex; MAX_AGENTS]

The number of messages sent by each agent.

§message_ids: [MessageId; MAX_MESSAGES]

The messages sent by each agent.

§invalid_id: InvalidId

The invalid condition, if any.

Trait Implementations§

Source§

impl<StateId: Clone + IndexLike, MessageId: Clone + IndexLike, InvalidId: Clone + IndexLike, const MAX_AGENTS: usize, const MAX_MESSAGES: usize> Clone for Configuration<StateId, MessageId, InvalidId, MAX_AGENTS, MAX_MESSAGES>

Source§

fn clone( &self, ) -> Configuration<StateId, MessageId, InvalidId, MAX_AGENTS, MAX_MESSAGES>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<StateId: Debug + IndexLike, MessageId: Debug + IndexLike, InvalidId: Debug + IndexLike, const MAX_AGENTS: usize, const MAX_MESSAGES: usize> Debug for Configuration<StateId, MessageId, InvalidId, MAX_AGENTS, MAX_MESSAGES>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<StateId: IndexLike, MessageId: IndexLike, InvalidId: IndexLike, const MAX_AGENTS: usize, const MAX_MESSAGES: usize> Default for Configuration<StateId, MessageId, InvalidId, MAX_AGENTS, MAX_MESSAGES>

Source§

fn default() -> Self

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

impl<StateId: Hash + IndexLike, MessageId: Hash + IndexLike, InvalidId: Hash + IndexLike, const MAX_AGENTS: usize, const MAX_MESSAGES: usize> Hash for Configuration<StateId, MessageId, InvalidId, MAX_AGENTS, MAX_MESSAGES>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<StateId: PartialEq + IndexLike, MessageId: PartialEq + IndexLike, InvalidId: PartialEq + IndexLike, const MAX_AGENTS: usize, const MAX_MESSAGES: usize> PartialEq for Configuration<StateId, MessageId, InvalidId, MAX_AGENTS, MAX_MESSAGES>

Source§

fn eq( &self, other: &Configuration<StateId, MessageId, InvalidId, MAX_AGENTS, MAX_MESSAGES>, ) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<StateId: Copy + IndexLike, MessageId: Copy + IndexLike, InvalidId: Copy + IndexLike, const MAX_AGENTS: usize, const MAX_MESSAGES: usize> Copy for Configuration<StateId, MessageId, InvalidId, MAX_AGENTS, MAX_MESSAGES>

Source§

impl<StateId: Eq + IndexLike, MessageId: Eq + IndexLike, InvalidId: Eq + IndexLike, const MAX_AGENTS: usize, const MAX_MESSAGES: usize> Eq for Configuration<StateId, MessageId, InvalidId, MAX_AGENTS, MAX_MESSAGES>

Source§

impl<StateId: IndexLike, MessageId: IndexLike, InvalidId: IndexLike, const MAX_AGENTS: usize, const MAX_MESSAGES: usize> StructuralPartialEq for Configuration<StateId, MessageId, InvalidId, MAX_AGENTS, MAX_MESSAGES>

Auto Trait Implementations§

§

impl<StateId, MessageId, InvalidId, const MAX_AGENTS: usize, const MAX_MESSAGES: usize> Freeze for Configuration<StateId, MessageId, InvalidId, MAX_AGENTS, MAX_MESSAGES>
where InvalidId: Freeze, StateId: Freeze, MessageId: Freeze,

§

impl<StateId, MessageId, InvalidId, const MAX_AGENTS: usize, const MAX_MESSAGES: usize> RefUnwindSafe for Configuration<StateId, MessageId, InvalidId, MAX_AGENTS, MAX_MESSAGES>
where InvalidId: RefUnwindSafe, StateId: RefUnwindSafe, MessageId: RefUnwindSafe,

§

impl<StateId, MessageId, InvalidId, const MAX_AGENTS: usize, const MAX_MESSAGES: usize> Send for Configuration<StateId, MessageId, InvalidId, MAX_AGENTS, MAX_MESSAGES>
where InvalidId: Send, StateId: Send, MessageId: Send,

§

impl<StateId, MessageId, InvalidId, const MAX_AGENTS: usize, const MAX_MESSAGES: usize> Sync for Configuration<StateId, MessageId, InvalidId, MAX_AGENTS, MAX_MESSAGES>
where InvalidId: Sync, StateId: Sync, MessageId: Sync,

§

impl<StateId, MessageId, InvalidId, const MAX_AGENTS: usize, const MAX_MESSAGES: usize> Unpin for Configuration<StateId, MessageId, InvalidId, MAX_AGENTS, MAX_MESSAGES>
where InvalidId: Unpin, StateId: Unpin, MessageId: Unpin,

§

impl<StateId, MessageId, InvalidId, const MAX_AGENTS: usize, const MAX_MESSAGES: usize> UnwindSafe for Configuration<StateId, MessageId, InvalidId, MAX_AGENTS, MAX_MESSAGES>
where InvalidId: UnwindSafe, StateId: UnwindSafe, MessageId: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CallHasher for T
where T: Hash + ?Sized,

Source§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64
where H: Hash + ?Sized, B: BuildHasher,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.