pub struct XDFFile {
pub version: f32,
pub header: Element,
pub streams: Vec<Stream>,
}Expand description
XDF file struct The main struct representing an XDF file.
Fields§
§version: f32XDF version. Currently only 1.0 exists according to the specification.
header: ElementThe XML header of the XDF file as an xmltree::Element.
streams: Vec<Stream>A vector of streams contained in the XDF file.
Implementations§
Source§impl XDFFile
impl XDFFile
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, XDFError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, XDFError>
Parse an XDF file from a byte slice.
§Arguments
bytes- A byte slice of the whole XDF file as read from disk.
§Returns
- A Result containing the parsed
XDFFileor an [XDFError]
§Errors
Will error if the file could not be parsed correctly for various reasons. See [XDFError] for more information.
§Example
let bytes = fs::read("tests/minimal.xdf")?;
let xdf_file = XDFFile::from_bytes(&bytes)?;Trait Implementations§
impl StructuralPartialEq for XDFFile
Auto Trait Implementations§
impl Freeze for XDFFile
impl RefUnwindSafe for XDFFile
impl Send for XDFFile
impl Sync for XDFFile
impl Unpin for XDFFile
impl UnwindSafe for XDFFile
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