pub struct DefinitionManifest { /* private fields */ }Expand description
A validated, read-only view of one canonical definition manifest.
The reader accepts every manifest format this runtime understands, so a deployment can inspect a definition persisted by an older release. It never guesses: a newer format, a non-canonical encoding, a floating-point value, an out-of-bound graph, or a digest that does not match the supplied bytes fails closed.
The runnable example lives in the oxide-batch facade documentation,
because the supported import path is oxide_batch.
Implementations§
Source§impl DefinitionManifest
impl DefinitionManifest
Sourcepub fn read(bytes: &[u8]) -> Result<Self, ManifestError>
pub fn read(bytes: &[u8]) -> Result<Self, ManifestError>
Reads and validates canonical manifest bytes.
§Errors
Returns ManifestError when the bytes exceed the durable bound, are
not a canonical JSON object, omit or overflow the format member, declare
a format this runtime cannot interpret, contain a floating-point value,
or describe a graph outside the accepted bounds.
Sourcepub fn read_verified(
bytes: &[u8],
expected: &[u8; 32],
) -> Result<Self, ManifestError>
pub fn read_verified( bytes: &[u8], expected: &[u8; 32], ) -> Result<Self, ManifestError>
Reads canonical bytes and requires them to hash to expected.
§Errors
Returns every ManifestError read returns, plus
ManifestError::DigestMismatch when the bytes were altered.
Sourcepub const fn digest(&self) -> &[u8; 32]
pub const fn digest(&self) -> &[u8; 32]
Returns the SHA-256 digest of the exact bytes that were read.
Sourcepub const fn job_name(&self) -> Option<&JobName>
pub const fn job_name(&self) -> Option<&JobName>
Borrows the job name bound into the manifest, when present.
Sourcepub const fn node_count(&self) -> Option<usize>
pub const fn node_count(&self) -> Option<usize>
Returns the compiled node count of a flow manifest.
Sourcepub const fn transition_count(&self) -> Option<usize>
pub const fn transition_count(&self) -> Option<usize>
Returns the compiled transition count of a flow manifest.
Trait Implementations§
Source§impl Clone for DefinitionManifest
impl Clone for DefinitionManifest
Source§fn clone(&self) -> DefinitionManifest
fn clone(&self) -> DefinitionManifest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more