pub struct AlphabetRegistry<A: SerialAlphabet> { /* private fields */ }Expand description
A same-type alphabet registry that rejects duplicate stable identities.
The registry is deliberately a value-layer helper, not a global singleton.
Implementations§
Source§impl<A: SerialAlphabet> AlphabetRegistry<A>
impl<A: SerialAlphabet> AlphabetRegistry<A>
Sourcepub fn insert(&mut self, alphabet: A) -> Result<(), AlphabetError>
pub fn insert(&mut self, alphabet: A) -> Result<(), AlphabetError>
Validates and inserts an alphabet, rejecting an id already in the registry.
Sourcepub fn get(&self, id: &AlphabetId) -> Option<&A>
pub fn get(&self, id: &AlphabetId) -> Option<&A>
Looks up an alphabet by stable identity.
Trait Implementations§
Source§impl<A: Clone + SerialAlphabet> Clone for AlphabetRegistry<A>
impl<A: Clone + SerialAlphabet> Clone for AlphabetRegistry<A>
Source§fn clone(&self) -> AlphabetRegistry<A>
fn clone(&self) -> AlphabetRegistry<A>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<A: Debug + SerialAlphabet> Debug for AlphabetRegistry<A>
impl<A: Debug + SerialAlphabet> Debug for AlphabetRegistry<A>
Source§impl<A: SerialAlphabet> Default for AlphabetRegistry<A>
impl<A: SerialAlphabet> Default for AlphabetRegistry<A>
impl<A: Eq + SerialAlphabet> Eq for AlphabetRegistry<A>
Source§impl<A: PartialEq + SerialAlphabet> PartialEq for AlphabetRegistry<A>
impl<A: PartialEq + SerialAlphabet> PartialEq for AlphabetRegistry<A>
impl<A: PartialEq + SerialAlphabet> StructuralPartialEq for AlphabetRegistry<A>
Auto Trait Implementations§
impl<A> Freeze for AlphabetRegistry<A>
impl<A> RefUnwindSafe for AlphabetRegistry<A>where
A: RefUnwindSafe,
impl<A> Send for AlphabetRegistry<A>where
A: Send,
impl<A> Sync for AlphabetRegistry<A>where
A: Sync,
impl<A> Unpin for AlphabetRegistry<A>
impl<A> UnsafeUnpin for AlphabetRegistry<A>
impl<A> UnwindSafe for AlphabetRegistry<A>where
A: RefUnwindSafe,
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