Struct LazyData

Source
pub struct LazyData {
    pub path: PathBuf,
    pub lazy_type: LazyType,
    /* private fields */
}

Fields§

§path: PathBuf§lazy_type: LazyType

Implementations§

Source§

impl LazyData

Source

pub fn collect_binary(self) -> Result<Box<[u8]>, LDBError>

§Expensive Action

( Reads all of the contents of the file and stores it on the heap )


Collects the LazyData as a Box<[u8]>.

Returns LDBError::IncorrectType if the LazyData type is not LazyType::Binary

Source

pub fn collect_string(self) -> Result<String, LDBError>

§Expensive Action

( Loads the entire file’s data into memory )


Collects the LazyData as a String

Returns LDBError::IncorrectType if LazyData type is not LazyType::String Returns LDBError::IOError if there is an io error while reading file contents

Source

pub fn collect_u8(self) -> Result<u8, LDBError>

§Expensive Action

( Loads the entire file’s data into memory )


Collects the LazyData as an unsigned integer.

Returns LDBError::IncorrectType if the LazyData type is not the correct unsigned integer

Source

pub fn collect_u16(self) -> Result<u16, LDBError>

§Expensive Action

( Loads the entire file’s data into memory )


Collects the LazyData as an unsigned integer.

Returns LDBError::IncorrectType if the LazyData type is not the correct unsigned integer

Source

pub fn collect_u32(self) -> Result<u32, LDBError>

§Expensive Action

( Loads the entire file’s data into memory )


Collects the LazyData as an unsigned integer.

Returns LDBError::IncorrectType if the LazyData type is not the correct unsigned integer

Source

pub fn collect_u64(self) -> Result<u64, LDBError>

§Expensive Action

( Loads the entire file’s data into memory )


Collects the LazyData as an unsigned integer.

Returns LDBError::IncorrectType if the LazyData type is not the correct unsigned integer

Source

pub fn collect_u128(self) -> Result<u128, LDBError>

§Expensive Action

( Loads the entire file’s data into memory )


Collects the LazyData as an unsigned integer.

Returns LDBError::IncorrectType if the LazyData type is not the correct unsigned integer

Source

pub fn collect_i8(self) -> Result<i8, LDBError>

§Expensive Action

( Loads the entire file’s data into memory )


Collects the LazyData as a signed integer.

Returns LDBError::IncorrectType if the LazyData type is not the correct signed integer

Source

pub fn collect_i16(self) -> Result<i16, LDBError>

§Expensive Action

( Loads the entire file’s data into memory )


Collects the LazyData as a signed integer.

Returns LDBError::IncorrectType if the LazyData type is not the correct signed integer

Source

pub fn collect_i32(self) -> Result<i32, LDBError>

§Expensive Action

( Loads the entire file’s data into memory )


Collects the LazyData as a signed integer.

Returns LDBError::IncorrectType if the LazyData type is not the correct signed integer

Source

pub fn collect_i64(self) -> Result<i64, LDBError>

§Expensive Action

( Loads the entire file’s data into memory )


Collects the LazyData as a signed integer.

Returns LDBError::IncorrectType if the LazyData type is not the correct signed integer

Source

pub fn collect_i128(self) -> Result<i128, LDBError>

§Expensive Action

( Loads the entire file’s data into memory )


Collects the LazyData as a signed integer.

Returns LDBError::IncorrectType if the LazyData type is not the correct signed integer

Source

pub fn collect_u8_array(self) -> Result<Box<[u8]>, LDBError>

§Expensive Action

( Loads the entire file’s data into memory )


Collects the LazyData as an array of values of a single type

Returns LDBError::IncorrectType if the LazyData type is not the correct array type

Source

pub fn collect_u16_array(self) -> Result<Box<[u16]>, LDBError>

§Expensive Action

( Loads the entire file’s data into memory )


Collects the LazyData as an array of values of a single type

Returns LDBError::IncorrectType if the LazyData type is not the correct array type

Source

pub fn collect_u32_array(self) -> Result<Box<[u32]>, LDBError>

§Expensive Action

( Loads the entire file’s data into memory )


Collects the LazyData as an array of values of a single type

Returns LDBError::IncorrectType if the LazyData type is not the correct array type

Source

pub fn collect_u64_array(self) -> Result<Box<[u64]>, LDBError>

§Expensive Action

( Loads the entire file’s data into memory )


Collects the LazyData as an array of values of a single type

Returns LDBError::IncorrectType if the LazyData type is not the correct array type

Source

pub fn collect_u128_array(self) -> Result<Box<[u128]>, LDBError>

§Expensive Action

( Loads the entire file’s data into memory )


Collects the LazyData as an array of values of a single type

Returns LDBError::IncorrectType if the LazyData type is not the correct array type

Source

pub fn collect_i8_array(self) -> Result<Box<[i8]>, LDBError>

§Expensive Action

( Loads the entire file’s data into memory )


Collects the LazyData as an array of values of a single type

Returns LDBError::IncorrectType if the LazyData type is not the correct array type

Source

pub fn collect_i16_array(self) -> Result<Box<[i16]>, LDBError>

§Expensive Action

( Loads the entire file’s data into memory )


Collects the LazyData as an array of values of a single type

Returns LDBError::IncorrectType if the LazyData type is not the correct array type

Source

pub fn collect_i32_array(self) -> Result<Box<[i32]>, LDBError>

§Expensive Action

( Loads the entire file’s data into memory )


Collects the LazyData as an array of values of a single type

Returns LDBError::IncorrectType if the LazyData type is not the correct array type

Source

pub fn collect_i64_array(self) -> Result<Box<[i64]>, LDBError>

§Expensive Action

( Loads the entire file’s data into memory )


Collects the LazyData as an array of values of a single type

Returns LDBError::IncorrectType if the LazyData type is not the correct array type

Source

pub fn collect_i128_array(self) -> Result<Box<[i128]>, LDBError>

§Expensive Action

( Loads the entire file’s data into memory )


Collects the LazyData as an array of values of a single type

Returns LDBError::IncorrectType if the LazyData type is not the correct array type

Source

pub fn collect_f32_array(self) -> Result<Box<[f32]>, LDBError>

§Expensive Action

( Loads the entire file’s data into memory )


Collects the LazyData as an array of values of a single type

Returns LDBError::IncorrectType if the LazyData type is not the correct array type

Source

pub fn collect_f64_array(self) -> Result<Box<[f64]>, LDBError>

§Expensive Action

( Loads the entire file’s data into memory )


Collects the LazyData as an array of values of a single type

Returns LDBError::IncorrectType if the LazyData type is not the correct array type

Source

pub fn collect_f32(self) -> Result<f32, LDBError>

§Expensive Action

( Loads the entire file’s data into memory )


Collects the LazyData as an f32.

Returns LDBError::IncorrectType if the LazyData type is not ``LazyFloat::F32`

Source

pub fn collect_f64(self) -> Result<f64, LDBError>

§Expensive Action

( Loads the entire file’s data into memory )


Collects the LazyData as an f64.

Returns LDBError::IncorrectType if the LazyData type is ``LazyFloatType::F64`

Source

pub fn collect_bool(self) -> Result<bool, LDBError>

§Inexpensive Action

( Just reads the type field of LazyData )


Collects the LazyData as a boolean

Returns LDBError::IncorrectType if the type is not of boolean

§Inexpensive Action

( Loads LazyData specified at path )


Collects the LazyData as a path and converts that into another LazyData.

Source§

impl LazyData

Source

pub fn new_void(file: FileWrapper, _value: ()) -> Result<(), LDBError>

Creates a new LazyData file with the type of LazyType::Void

Source

pub fn new_string(file: FileWrapper, value: &str) -> Result<(), LDBError>

Creates a new LazyData file with a String value and type

Source

pub fn new_i8(file: FileWrapper, value: i8) -> Result<(), LDBError>

Creates a new LazyData file with a signed integer and type

Source

pub fn new_i16(file: FileWrapper, value: i16) -> Result<(), LDBError>

Creates a new LazyData file with a signed integer and type

Source

pub fn new_i32(file: FileWrapper, value: i32) -> Result<(), LDBError>

Creates a new LazyData file with a signed integer and type

Source

pub fn new_i64(file: FileWrapper, value: i64) -> Result<(), LDBError>

Creates a new LazyData file with a signed integer and type

Source

pub fn new_i128(file: FileWrapper, value: i128) -> Result<(), LDBError>

Creates a new LazyData file with a signed integer and type

Source

pub fn new_u8(file: FileWrapper, value: u8) -> Result<(), LDBError>

Creates a new LazyData file with an unsigned integer and type

Source

pub fn new_u16(file: FileWrapper, value: u16) -> Result<(), LDBError>

Creates a new LazyData file with an unsigned integer and type

Source

pub fn new_u32(file: FileWrapper, value: u32) -> Result<(), LDBError>

Creates a new LazyData file with an unsigned integer and type

Source

pub fn new_u64(file: FileWrapper, value: u64) -> Result<(), LDBError>

Creates a new LazyData file with an unsigned integer and type

Source

pub fn new_u128(file: FileWrapper, value: u128) -> Result<(), LDBError>

Creates a new LazyData file with an unsigned integer and type

Source

pub fn new_u8_array(file: FileWrapper, value: &[u8]) -> Result<(), LDBError>

Creates a new LazyData file with an array type and value

Source

pub fn new_u16_array(file: FileWrapper, value: &[u16]) -> Result<(), LDBError>

Creates a new LazyData file with an array type and value

Source

pub fn new_u32_array(file: FileWrapper, value: &[u32]) -> Result<(), LDBError>

Creates a new LazyData file with an array type and value

Source

pub fn new_u64_array(file: FileWrapper, value: &[u64]) -> Result<(), LDBError>

Creates a new LazyData file with an array type and value

Source

pub fn new_u128_array(file: FileWrapper, value: &[u128]) -> Result<(), LDBError>

Creates a new LazyData file with an array type and value

Source

pub fn new_i8_array(file: FileWrapper, value: &[i8]) -> Result<(), LDBError>

Creates a new LazyData file with an array type and value

Source

pub fn new_i16_array(file: FileWrapper, value: &[i16]) -> Result<(), LDBError>

Creates a new LazyData file with an array type and value

Source

pub fn new_i32_array(file: FileWrapper, value: &[i32]) -> Result<(), LDBError>

Creates a new LazyData file with an array type and value

Source

pub fn new_i64_array(file: FileWrapper, value: &[i64]) -> Result<(), LDBError>

Creates a new LazyData file with an array type and value

Source

pub fn new_i128_array(file: FileWrapper, value: &[i128]) -> Result<(), LDBError>

Creates a new LazyData file with an array type and value

Source

pub fn new_f32_array(file: FileWrapper, value: &[f32]) -> Result<(), LDBError>

Creates a new LazyData file with an array type and value

Source

pub fn new_f64_array(file: FileWrapper, value: &[f64]) -> Result<(), LDBError>

Creates a new LazyData file with an array type and value

Source

pub fn new_f32(file: FileWrapper, value: f32) -> Result<(), LDBError>

Creates a new LazyData file with an f32 value and type

Source

pub fn new_f64(file: FileWrapper, value: f64) -> Result<(), LDBError>

Creates a new LazyData file with an f64 value and type

Source

pub fn new_binary(file: FileWrapper, value: &[u8]) -> Result<(), LDBError>

Creates a new LazyData file with a binary value and type

Source

pub fn new_bool(file: FileWrapper, value: bool) -> Result<(), LDBError>

Creates a new LazyData file with a bool value and type

Creates a new LazyData file with a link (it’s like a reference) value and type

Source§

impl LazyData

Source

pub fn load(path: impl AsRef<Path>) -> Result<Self, LDBError>

Source

pub fn get_path(&self) -> PathBuf

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.