pub struct GeneratedFormatCache { /* private fields */ }Expand description
A cached snapshot of a generated engine format image for repeated instantiation.
Implementations§
Source§impl GeneratedFormatCache
impl GeneratedFormatCache
Sourcepub fn initialized(profile: EngineProfile) -> Self
pub fn initialized(profile: EngineProfile) -> Self
Initializes a generated engine once and snapshots it as a reusable format cache.
Sourcepub fn from_engine(engine: &PortableTexEngine<'_>) -> Self
pub fn from_engine(engine: &PortableTexEngine<'_>) -> Self
Snapshots the engine’s current format state into a reusable cache.
Sourcepub fn from_engine_owned(engine: PortableTexEngine<'_>) -> Self
pub fn from_engine_owned(engine: PortableTexEngine<'_>) -> Self
Consumes an engine into a format cache by moving its state in place, avoiding a full clone.
Sourcepub fn image(&self) -> &PortableFormatImage
pub fn image(&self) -> &PortableFormatImage
Returns a reference to the raw format image.
Sourcepub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn to_bytes(&self) -> Vec<u8> ⓘ
Serializes the format image to a buffer valid for the same build target only.
Sourcepub fn from_bytes(bytes: &[u8]) -> Option<Self>
pub fn from_bytes(bytes: &[u8]) -> Option<Self>
Deserializes a format cache from a buffer produced by Self::to_bytes.
Sourcepub fn instantiate<'resources, R>(
&self,
profile: EngineProfile,
resources: R,
) -> PortableTexEngine<'resources>where
R: ResourceProvider + 'resources,
pub fn instantiate<'resources, R>(
&self,
profile: EngineProfile,
resources: R,
) -> PortableTexEngine<'resources>where
R: ResourceProvider + 'resources,
Creates a new engine instance from this cached format image.
Trait Implementations§
Source§impl Clone for GeneratedFormatCache
impl Clone for GeneratedFormatCache
Source§fn clone(&self) -> GeneratedFormatCache
fn clone(&self) -> GeneratedFormatCache
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GeneratedFormatCache
impl Debug for GeneratedFormatCache
Auto Trait Implementations§
impl !Send for GeneratedFormatCache
impl !Sync for GeneratedFormatCache
impl Freeze for GeneratedFormatCache
impl RefUnwindSafe for GeneratedFormatCache
impl Unpin for GeneratedFormatCache
impl UnsafeUnpin for GeneratedFormatCache
impl UnwindSafe for GeneratedFormatCache
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