Struct IndexedEncodings
pub struct IndexedEncodings<A: Arch, C: Computation> { /* private fields */ }
Expand description
A collection of encodings which can be accessed using EncodingId
s.
Implementations§
§impl<A: Arch, C: Computation> IndexedEncodings<A, C>
impl<A: Arch, C: Computation> IndexedEncodings<A, C>
pub fn new() -> Self
pub fn new() -> Self
Creates an empty collection.
pub fn add(&mut self, encoding: EncodingWithFilters<A, C>) -> EncodingId
pub fn add(&mut self, encoding: EncodingWithFilters<A, C>) -> EncodingId
Adds a new encoding. The ID returned can be permanently used to obtain a reference to the encoding from this collection.
pub fn all(&self) -> impl Iterator<Item = &EncodingWithFilters<A, C>>
pub fn all(&self) -> impl Iterator<Item = &EncodingWithFilters<A, C>>
Iterates over all encodings in the collection.
Trait Implementations§
§impl<A: Arch, C: Computation> Default for IndexedEncodings<A, C>
impl<A: Arch, C: Computation> Default for IndexedEncodings<A, C>
§impl<'de, A: Arch, C> Deserialize<'de> for IndexedEncodings<A, C>where
C: Deserialize<'de> + Computation,
impl<'de, A: Arch, C> Deserialize<'de> for IndexedEncodings<A, C>where
C: Deserialize<'de> + Computation,
§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl<'a, A: Arch, C: Computation> Index<&'a EncodingId> for IndexedEncodings<A, C>
impl<'a, A: Arch, C: Computation> Index<&'a EncodingId> for IndexedEncodings<A, C>
§type Output = EncodingWithFilters<A, C>
type Output = EncodingWithFilters<A, C>
The returned type after indexing.
§fn index(&self, index: &'a EncodingId) -> &Self::Output
fn index(&self, index: &'a EncodingId) -> &Self::Output
Performs the indexing (
container[index]
) operation. Read more§impl<A: Arch, C: Computation> Index<EncodingId> for IndexedEncodings<A, C>
impl<A: Arch, C: Computation> Index<EncodingId> for IndexedEncodings<A, C>
§type Output = EncodingWithFilters<A, C>
type Output = EncodingWithFilters<A, C>
The returned type after indexing.
§fn index(&self, index: EncodingId) -> &Self::Output
fn index(&self, index: EncodingId) -> &Self::Output
Performs the indexing (
container[index]
) operation. Read more§impl<A: Arch, C> Serialize for IndexedEncodings<A, C>where
C: Serialize + Computation,
impl<A: Arch, C> Serialize for IndexedEncodings<A, C>where
C: Serialize + Computation,
Auto Trait Implementations§
impl<A, C> Freeze for IndexedEncodings<A, C>
impl<A, C> RefUnwindSafe for IndexedEncodings<A, C>
impl<A, C> Send for IndexedEncodings<A, C>where
C: Send,
impl<A, C> Sync for IndexedEncodings<A, C>where
C: Sync,
impl<A, C> Unpin for IndexedEncodings<A, C>
impl<A, C> UnwindSafe for IndexedEncodings<A, C>
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
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more