[][src]Struct binjs_io::io::statistics::PerUserExtensibleKind

pub struct PerUserExtensibleKind<T> {
    pub floats: T,
    pub unsigned_longs: T,
    pub property_keys: T,
    pub identifier_names: T,
    pub string_literals: T,
    pub list_lengths: T,
}

During compression, we typically deal with both grammar-fixed data (e.g. the list of possible values in a string enum) and user-extensible data (e.g. string literals).

This container is meant to store data associated with user-extensible data. This serves typically to store per-kind compression settings, per-kind compressed/decompressed data, dictionaries, etc.

Fields

floats: Tunsigned_longs: Tproperty_keys: Tidentifier_names: Tstring_literals: Tlist_lengths: T

Methods

impl<T> PerUserExtensibleKind<T>[src]

pub fn with<F>(f: F) -> Self where
    F: Fn(&str) -> T, 
[src]

Initialize a new PerUserExtensibleKind.

pub fn into_with<F, U>(self, f: F) -> PerUserExtensibleKind<U> where
    F: Fn(&str, T) -> U, 
[src]

Convert a PerUserExtensibleKind into another one.

pub fn iter(&self) -> impl Iterator<Item = (&'static str, &T)>[src]

pub fn iter_mut(&mut self) -> impl Iterator<Item = (&'static str, &mut T)>[src]

pub fn into_iter(self) -> impl Iterator<Item = (&'static str, T)>[src]

pub fn get(&self, field_name: &str) -> Option<&T>[src]

Access a field by its name.

This method is typically used to simplify parsing a file that contains sections explicitly labelled "bools", "floats", etc. In such case, field_name is expected to be a user input.

Return None if field_name is not one of the field names.

pub fn get_mut(&mut self, field_name: &str) -> Option<&mut T>[src]

pub fn get_mut_b(&mut self, field_name: &[u8]) -> Option<&mut T>[src]

Access a field by its name, specified as a sequence of bytes.

This method is typically used to simplify parsing a file that contains sections explicitly labelled "bools", "floats", etc. In such case, field_name is expected to be a user input.

Return None if field_name is not one of the field names.

pub fn get_b(&self, field_name: &[u8]) -> Option<&T>[src]

impl PerUserExtensibleKind<Writer<LengthWriter>>[src]

pub fn into_statistics(self) -> PerUserExtensibleKind<Bytes>[src]

Finalize and return the number of compressed bytes written.

This number is determined by examining the underlying LengthWriter.

Trait Implementations

impl<T: Add<Output = T>> Add<PerUserExtensibleKind<T>> for PerUserExtensibleKind<T>[src]

type Output = PerUserExtensibleKind<T>

The resulting type after applying the + operator.

impl<T: AddAssign> AddAssign<PerUserExtensibleKind<T>> for PerUserExtensibleKind<T>[src]

impl<T: Clone> Clone for PerUserExtensibleKind<T>[src]

impl<T: Debug> Debug for PerUserExtensibleKind<T>[src]

impl<T: Default> Default for PerUserExtensibleKind<T>[src]

impl Display for PerUserExtensibleKind<BytesAndInstances>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for PerUserExtensibleKind<T> where
    T: RefUnwindSafe

impl<T> Send for PerUserExtensibleKind<T> where
    T: Send

impl<T> Sync for PerUserExtensibleKind<T> where
    T: Sync

impl<T> Unpin for PerUserExtensibleKind<T> where
    T: Unpin

impl<T> UnwindSafe for PerUserExtensibleKind<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Downcast for T where
    T: Any
[src]

impl<T> DowncastSync for T where
    T: Send + Sync + Any
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]