pub struct LazyData {
pub path: PathBuf,
pub lazy_type: LazyType,
/* private fields */
}
Fields§
§path: PathBuf
§lazy_type: LazyType
Implementations§
Source§impl LazyData
impl LazyData
Sourcepub fn collect_binary(self) -> Result<Box<[u8]>, LDBError>
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
Sourcepub fn collect_string(self) -> Result<String, LDBError>
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
Sourcepub fn collect_u8(self) -> Result<u8, LDBError>
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
Sourcepub fn collect_u16(self) -> Result<u16, LDBError>
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
Sourcepub fn collect_u32(self) -> Result<u32, LDBError>
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
Sourcepub fn collect_u64(self) -> Result<u64, LDBError>
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
Sourcepub fn collect_u128(self) -> Result<u128, LDBError>
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
Sourcepub fn collect_i8(self) -> Result<i8, LDBError>
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
Sourcepub fn collect_i16(self) -> Result<i16, LDBError>
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
Sourcepub fn collect_i32(self) -> Result<i32, LDBError>
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
Sourcepub fn collect_i64(self) -> Result<i64, LDBError>
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
Sourcepub fn collect_i128(self) -> Result<i128, LDBError>
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
Sourcepub fn collect_u8_array(self) -> Result<Box<[u8]>, LDBError>
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
Sourcepub fn collect_u16_array(self) -> Result<Box<[u16]>, LDBError>
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
Sourcepub fn collect_u32_array(self) -> Result<Box<[u32]>, LDBError>
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
Sourcepub fn collect_u64_array(self) -> Result<Box<[u64]>, LDBError>
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
Sourcepub fn collect_u128_array(self) -> Result<Box<[u128]>, LDBError>
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
Sourcepub fn collect_i8_array(self) -> Result<Box<[i8]>, LDBError>
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
Sourcepub fn collect_i16_array(self) -> Result<Box<[i16]>, LDBError>
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
Sourcepub fn collect_i32_array(self) -> Result<Box<[i32]>, LDBError>
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
Sourcepub fn collect_i64_array(self) -> Result<Box<[i64]>, LDBError>
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
Sourcepub fn collect_i128_array(self) -> Result<Box<[i128]>, LDBError>
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
Sourcepub fn collect_f32_array(self) -> Result<Box<[f32]>, LDBError>
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
Sourcepub fn collect_f64_array(self) -> Result<Box<[f64]>, LDBError>
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
Sourcepub fn collect_f32(self) -> Result<f32, LDBError>
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`
Sourcepub fn collect_f64(self) -> Result<f64, LDBError>
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§impl LazyData
impl LazyData
Sourcepub fn new_void(file: FileWrapper, _value: ()) -> Result<(), LDBError>
pub fn new_void(file: FileWrapper, _value: ()) -> Result<(), LDBError>
Creates a new LazyData
file with the type of LazyType::Void
Sourcepub fn new_string(file: FileWrapper, value: &str) -> Result<(), LDBError>
pub fn new_string(file: FileWrapper, value: &str) -> Result<(), LDBError>
Creates a new LazyData
file with a String
value and type
Sourcepub fn new_i8(file: FileWrapper, value: i8) -> Result<(), LDBError>
pub fn new_i8(file: FileWrapper, value: i8) -> Result<(), LDBError>
Creates a new LazyData
file with a signed integer and type
Sourcepub fn new_i16(file: FileWrapper, value: i16) -> Result<(), LDBError>
pub fn new_i16(file: FileWrapper, value: i16) -> Result<(), LDBError>
Creates a new LazyData
file with a signed integer and type
Sourcepub fn new_i32(file: FileWrapper, value: i32) -> Result<(), LDBError>
pub fn new_i32(file: FileWrapper, value: i32) -> Result<(), LDBError>
Creates a new LazyData
file with a signed integer and type
Sourcepub fn new_i64(file: FileWrapper, value: i64) -> Result<(), LDBError>
pub fn new_i64(file: FileWrapper, value: i64) -> Result<(), LDBError>
Creates a new LazyData
file with a signed integer and type
Sourcepub fn new_i128(file: FileWrapper, value: i128) -> Result<(), LDBError>
pub fn new_i128(file: FileWrapper, value: i128) -> Result<(), LDBError>
Creates a new LazyData
file with a signed integer and type
Sourcepub fn new_u8(file: FileWrapper, value: u8) -> Result<(), LDBError>
pub fn new_u8(file: FileWrapper, value: u8) -> Result<(), LDBError>
Creates a new LazyData
file with an unsigned integer and type
Sourcepub fn new_u16(file: FileWrapper, value: u16) -> Result<(), LDBError>
pub fn new_u16(file: FileWrapper, value: u16) -> Result<(), LDBError>
Creates a new LazyData
file with an unsigned integer and type
Sourcepub fn new_u32(file: FileWrapper, value: u32) -> Result<(), LDBError>
pub fn new_u32(file: FileWrapper, value: u32) -> Result<(), LDBError>
Creates a new LazyData
file with an unsigned integer and type
Sourcepub fn new_u64(file: FileWrapper, value: u64) -> Result<(), LDBError>
pub fn new_u64(file: FileWrapper, value: u64) -> Result<(), LDBError>
Creates a new LazyData
file with an unsigned integer and type
Sourcepub fn new_u128(file: FileWrapper, value: u128) -> Result<(), LDBError>
pub fn new_u128(file: FileWrapper, value: u128) -> Result<(), LDBError>
Creates a new LazyData
file with an unsigned integer and type
Sourcepub fn new_u8_array(file: FileWrapper, value: &[u8]) -> Result<(), LDBError>
pub fn new_u8_array(file: FileWrapper, value: &[u8]) -> Result<(), LDBError>
Creates a new LazyData
file with an array type and value
Sourcepub fn new_u16_array(file: FileWrapper, value: &[u16]) -> Result<(), LDBError>
pub fn new_u16_array(file: FileWrapper, value: &[u16]) -> Result<(), LDBError>
Creates a new LazyData
file with an array type and value
Sourcepub fn new_u32_array(file: FileWrapper, value: &[u32]) -> Result<(), LDBError>
pub fn new_u32_array(file: FileWrapper, value: &[u32]) -> Result<(), LDBError>
Creates a new LazyData
file with an array type and value
Sourcepub fn new_u64_array(file: FileWrapper, value: &[u64]) -> Result<(), LDBError>
pub fn new_u64_array(file: FileWrapper, value: &[u64]) -> Result<(), LDBError>
Creates a new LazyData
file with an array type and value
Sourcepub fn new_u128_array(file: FileWrapper, value: &[u128]) -> Result<(), LDBError>
pub fn new_u128_array(file: FileWrapper, value: &[u128]) -> Result<(), LDBError>
Creates a new LazyData
file with an array type and value
Sourcepub fn new_i8_array(file: FileWrapper, value: &[i8]) -> Result<(), LDBError>
pub fn new_i8_array(file: FileWrapper, value: &[i8]) -> Result<(), LDBError>
Creates a new LazyData
file with an array type and value
Sourcepub fn new_i16_array(file: FileWrapper, value: &[i16]) -> Result<(), LDBError>
pub fn new_i16_array(file: FileWrapper, value: &[i16]) -> Result<(), LDBError>
Creates a new LazyData
file with an array type and value
Sourcepub fn new_i32_array(file: FileWrapper, value: &[i32]) -> Result<(), LDBError>
pub fn new_i32_array(file: FileWrapper, value: &[i32]) -> Result<(), LDBError>
Creates a new LazyData
file with an array type and value
Sourcepub fn new_i64_array(file: FileWrapper, value: &[i64]) -> Result<(), LDBError>
pub fn new_i64_array(file: FileWrapper, value: &[i64]) -> Result<(), LDBError>
Creates a new LazyData
file with an array type and value
Sourcepub fn new_i128_array(file: FileWrapper, value: &[i128]) -> Result<(), LDBError>
pub fn new_i128_array(file: FileWrapper, value: &[i128]) -> Result<(), LDBError>
Creates a new LazyData
file with an array type and value
Sourcepub fn new_f32_array(file: FileWrapper, value: &[f32]) -> Result<(), LDBError>
pub fn new_f32_array(file: FileWrapper, value: &[f32]) -> Result<(), LDBError>
Creates a new LazyData
file with an array type and value
Sourcepub fn new_f64_array(file: FileWrapper, value: &[f64]) -> Result<(), LDBError>
pub fn new_f64_array(file: FileWrapper, value: &[f64]) -> Result<(), LDBError>
Creates a new LazyData
file with an array type and value
Sourcepub fn new_f32(file: FileWrapper, value: f32) -> Result<(), LDBError>
pub fn new_f32(file: FileWrapper, value: f32) -> Result<(), LDBError>
Creates a new LazyData
file with an f32
value and type
Sourcepub fn new_f64(file: FileWrapper, value: f64) -> Result<(), LDBError>
pub fn new_f64(file: FileWrapper, value: f64) -> Result<(), LDBError>
Creates a new LazyData
file with an f64
value and type
Sourcepub fn new_binary(file: FileWrapper, value: &[u8]) -> Result<(), LDBError>
pub fn new_binary(file: FileWrapper, value: &[u8]) -> Result<(), LDBError>
Creates a new LazyData
file with a binary
value and type