pub struct IDXFile {
pub dimensions: Vec<u32>,
pub matrix_data: Row,
}
Expand description
holds parsed idx file data
Fields§
§dimensions: Vec<u32>
length of each of the dimensions. i.e [10, 20, 100] means the first dimension has a 10 elements, the second has 20, and third has 100
matrix_data: Row
multi dimensional matrix data
Implementations§
Source§impl IDXFile
impl IDXFile
Sourcepub fn from_bytes(bytes: Vec<u8>) -> Result<IDXFile, ParseError>
pub fn from_bytes(bytes: Vec<u8>) -> Result<IDXFile, ParseError>
parses bytes from an IDX file into a IDXFile
§Example
use std::fs::File;
use std::io::prelude::*;
use crate::idx_parser::IDXFile;
// byte vec
let mut buf: Vec<u8> = vec![];
// your IDX file
let mut file = File::open("tests/u8_dim3_test").unwrap();
// get bytes from IDX file
file.read_to_end(&mut buf).unwrap();
let my_idx_file = IDXFile::from_bytes(buf).unwrap();
assert_eq!(my_idx_file.dimensions, [1, 2,3])
Trait Implementations§
impl StructuralPartialEq for IDXFile
Auto Trait Implementations§
impl Freeze for IDXFile
impl RefUnwindSafe for IDXFile
impl Send for IDXFile
impl Sync for IDXFile
impl Unpin for IDXFile
impl UnwindSafe for IDXFile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more