pub struct OperationCatalog { /* private fields */ }Expand description
The operations offered to a turn, by key. A duplicate key is refused, never shadowed.
Implementations§
Source§impl OperationCatalog
impl OperationCatalog
Sourcepub fn new(
operations: impl IntoIterator<Item = OperationSpec>,
) -> Result<Self, ReductionError>
pub fn new( operations: impl IntoIterator<Item = OperationSpec>, ) -> Result<Self, ReductionError>
A catalog of operations.
§Errors
crate::error::ReductionError::DuplicateOperation for a key offered twice.
Sourcepub fn insert(&mut self, spec: OperationSpec) -> Result<(), ReductionError>
pub fn insert(&mut self, spec: OperationSpec) -> Result<(), ReductionError>
Sourcepub fn get(&self, key: &OperationKey) -> Option<&OperationSpec>
pub fn get(&self, key: &OperationKey) -> Option<&OperationSpec>
The operation with this key.
Sourcepub fn iter(&self) -> impl Iterator<Item = &OperationSpec>
pub fn iter(&self) -> impl Iterator<Item = &OperationSpec>
Every operation, in the order added.
Trait Implementations§
Source§impl Clone for OperationCatalog
impl Clone for OperationCatalog
Source§impl Debug for OperationCatalog
impl Debug for OperationCatalog
Source§impl Default for OperationCatalog
impl Default for OperationCatalog
Source§impl PartialEq for OperationCatalog
impl PartialEq for OperationCatalog
impl StructuralPartialEq for OperationCatalog
Auto Trait Implementations§
impl !RefUnwindSafe for OperationCatalog
impl !UnwindSafe for OperationCatalog
impl Freeze for OperationCatalog
impl Send for OperationCatalog
impl Sync for OperationCatalog
impl Unpin for OperationCatalog
impl UnsafeUnpin for OperationCatalog
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