pub struct PortableFormatImage { /* private fields */ }Expand description
A sealed engine state, decoded and validated once when loaded, that every engine instance clones.
Implementations§
Source§impl PortableFormatImage
impl PortableFormatImage
Sourcepub fn empty() -> Self
pub fn empty() -> Self
The image of a state before initialize_format_state, engines built from it only initialize.
Sourcepub fn validation_tag() -> [u8; 17]
pub fn validation_tag() -> [u8; 17]
Returns the validation tag stored at the start of every image this build writes.
Sourcepub fn bytes_match_target(bytes: &[u8]) -> bool
pub fn bytes_match_target(bytes: &[u8]) -> bool
Reports whether a serialized image carries this build’s validation tag.
Sourcepub fn from_static_bytes(bytes: &'static [u8]) -> Result<Self, FormatImageError>
pub fn from_static_bytes(bytes: &'static [u8]) -> Result<Self, FormatImageError>
Decodes and validates a static image once, later instantiation only clones the decoded state.
Sourcepub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn to_bytes(&self) -> Vec<u8> ⓘ
Serializes this image, the bytes are deterministic and load in this build on any target of the same byte order.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, FormatImageError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, FormatImageError>
Decodes and validates an image produced by Self::to_bytes.
Sourcepub fn state_array_bytes(&self) -> usize
pub fn state_array_bytes(&self) -> usize
Resident bytes of the engine arrays once instantiated from this image.
Trait Implementations§
Auto Trait Implementations§
impl !Send for PortableFormatImage
impl !Sync for PortableFormatImage
impl Freeze for PortableFormatImage
impl RefUnwindSafe for PortableFormatImage
impl Unpin for PortableFormatImage
impl UnsafeUnpin for PortableFormatImage
impl UnwindSafe for PortableFormatImage
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