[][src]Struct binjs::io::entropy::rw::PreludeStreams

pub struct PreludeStreams<T> {
    pub identifier_names: T,
    pub identifier_names_len: T,
    pub property_keys: T,
    pub property_keys_len: T,
    pub string_literals: T,
    pub string_literals_len: T,
    pub interface_names: T,
    pub string_enums: T,
    pub list_lengths: T,
    pub floats: T,
    pub unsigned_longs: T,
}

Prelude data.

The prelude contains streams to read or write dictionary extensions for user-extensible symbols (aka "prelude dictionaries").

Examples of T: LazyStream (for writing) or Cursor<Vec<u8>> (for reading).

Fields

identifier_names: T

Instances of IdentifierName.

To aid with compression, we typically store user-extensible strings as two distinct data structures:

identifier_names_len: Tproperty_keys: T

Instances of PropertyKey

To aid with compression, we typically store user-extensible strings as two distinct data structures:

property_keys_len: Tstring_literals: T

Instances of string literals.

To aid with compression, we typically store user-extensible strings as two distinct data structures:

string_literals_len: Tinterface_names: T

Instances of InterfaceName

string_enums: T

Instances of string enums.

list_lengths: T

Instances of list lengths.

floats: T

Instances of floating-point numbers.

unsigned_longs: T

Instances of unsigned longs.

Methods

impl<T> PreludeStreams<T>[src]

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

Create a new PreludeStreams.

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

Iterate through fields of PreludeStreams.

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 "identifier_names", "property_keys", 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.

Auto Trait Implementations

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

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

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

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

impl<T> UnwindSafe for PreludeStreams<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, 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]