Struct FlowData

Source
pub struct FlowData {
    pub unknown1: u32,
    pub unknown2: u16,
    /* private fields */
}
Expand description

Contain the data obtained from a binary flow file. It is hightly recommended to process it with [FlowDataOutput] if you plan to do high level modification on it.

The file contain a list of dictionaries, and a list of vectors, orderer.

Each entry of the dictionary/vector can be a string or a reference to another dic/vec

Dictionary are indixed by String, Vec by position.

Fields§

§unknown1: u32§unknown2: u16

Implementations§

Source§

impl FlowData

Source

pub fn push_dictionary( &mut self, values: HashMap<String, FlowDataValue>, ) -> Result<u16, FlowDataError>

A new dictionary to the FlowData

Source

pub fn push_vector( &mut self, values: Vec<FlowDataValue>, ) -> Result<u16, FlowDataError>

Add a new vector in the FlowData

Source

pub fn dictionary_len(&self) -> usize

return the number of dictionary

Source

pub fn vector_len(&self) -> usize

return the number of vector

Source

pub fn get_dictionary( &self, dicid: usize, ) -> Option<&HashMap<String, FlowDataValue>>

return a reference to a dictionary if it exist, None otherwise

Source

pub fn get_dictionary_mut( &mut self, dicid: usize, ) -> Option<&mut HashMap<String, FlowDataValue>>

return a mutable reference to a dictionary if it exist, None otherwise

Source

pub fn get_vector(&self, vecid: usize) -> Option<&Vec<FlowDataValue>>

return a reference to a vector if it exist, None otherwise.

Source

pub fn get_vector_mut( &mut self, vecid: usize, ) -> Option<&mut Vec<FlowDataValue>>

return a mutable reference to a vector if it exist, None otherwise.

Source§

impl FlowData

Source

pub fn new<T: Read + Seek>(file: &mut T) -> Result<FlowData, FlowDataError>

decode a binary flow file

Source

pub fn write<T: Write + Seek>(&self, file: &mut T) -> Result<(), FlowDataError>

encode a binary flow file

note that entry are automatically deduplicated.

Trait Implementations§

Source§

impl Debug for FlowData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FlowData

Source§

fn default() -> FlowData

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.