pub struct VTableContext<T>(/* private fields */);
Expand description
A collection of encodings that can be addressed by a u16 positional index. This is used to map array encodings and layout encodings when reading from a file.
Implementations§
Source§impl<T: Clone + Eq> VTableContext<T>
impl<T: Clone + Eq> VTableContext<T>
pub fn empty() -> Self
pub fn with(self, encoding: T) -> Self
pub fn with_many<E: IntoIterator<Item = T>>(self, items: E) -> Self
pub fn encodings(&self) -> Vec<T>
Sourcepub fn encoding_idx(&self, encoding: &T) -> u16
pub fn encoding_idx(&self, encoding: &T) -> u16
Returns the index of the encoding in the context, or adds it if it doesn’t exist.
Sourcepub fn lookup_encoding(&self, idx: u16) -> Option<T>
pub fn lookup_encoding(&self, idx: u16) -> Option<T>
Find an encoding by its position.
Trait Implementations§
Source§impl<T: Clone> Clone for VTableContext<T>
impl<T: Clone> Clone for VTableContext<T>
Source§fn clone(&self) -> VTableContext<T>
fn clone(&self) -> VTableContext<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<T> Freeze for VTableContext<T>
impl<T> !RefUnwindSafe for VTableContext<T>
impl<T> Send for VTableContext<T>
impl<T> Sync for VTableContext<T>
impl<T> Unpin for VTableContext<T>
impl<T> !UnwindSafe for VTableContext<T>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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