pub struct OxiFile {
pub version: u32,
pub root: Group,
}Expand description
Root container for the OxiPhy binary file format.
Binary layout:
- 8 bytes magic:
OXIPHY01 - 4 bytes version:
u32little-endian - Recursively serialized root group
Fields§
§version: u32§root: GroupImplementations§
Source§impl OxiFile
impl OxiFile
Sourcepub fn write_to_bytes(&self) -> Vec<u8> ⓘ
pub fn write_to_bytes(&self) -> Vec<u8> ⓘ
Serializes the entire file to a byte vector.
Sourcepub fn read_from_bytes(data: &[u8]) -> Result<Self, String>
pub fn read_from_bytes(data: &[u8]) -> Result<Self, String>
Deserializes an OxiFile from a byte slice.
Source§impl OxiFile
impl OxiFile
Sourcepub fn with_version(version: FormatVersion) -> Self
pub fn with_version(version: FormatVersion) -> Self
Create an OxiFile at a specific format version.
Sourcepub fn format_version(&self) -> Result<FormatVersion, String>
pub fn format_version(&self) -> Result<FormatVersion, String>
Return the parsed FormatVersion if recognised, else an error.
Sourcepub fn add_binary_mesh(&mut self, group: &str, mesh: &BinaryMesh)
pub fn add_binary_mesh(&mut self, group: &str, mesh: &BinaryMesh)
Store a BinaryMesh under the given group name.
Sourcepub fn get_binary_mesh(&self, group: &str) -> Result<BinaryMesh, String>
pub fn get_binary_mesh(&self, group: &str) -> Result<BinaryMesh, String>
Retrieve and decode a BinaryMesh from the given group.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OxiFile
impl RefUnwindSafe for OxiFile
impl Send for OxiFile
impl Sync for OxiFile
impl Unpin for OxiFile
impl UnsafeUnpin for OxiFile
impl UnwindSafe for OxiFile
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.