pub struct Model<'a> { /* private fields */ }Expand description
A verified, zero-copy TOSA graph.
Implementations§
Source§impl<'a> Model<'a>
impl<'a> Model<'a>
pub const fn version(&self) -> Version
pub const fn stats(&self) -> Stats
pub const fn as_bytes(&self) -> &'a [u8]
pub fn regions(&self) -> Regions<'a> ⓘ
Sourcepub fn validate_with<V: ModelValidator + ?Sized>(
&self,
validator: &mut V,
) -> Result<(), V::Error>
pub fn validate_with<V: ModelValidator + ?Sized>( &self, validator: &mut V, ) -> Result<(), V::Error>
Run an operator- or provider-specific validation pass over this safe graph view.
Sourcepub fn artifact_ref(
&self,
target: Target,
resident_bytes: u64,
) -> Result<ArtifactRef<'_>, ArtifactError>
pub fn artifact_ref( &self, target: Target, resident_bytes: u64, ) -> Result<ArtifactRef<'_>, ArtifactError>
Wrap these exact validated bytes in the standard virtio-accel artifact envelope.
Sourcepub fn validate_for(&self, target: Target) -> Result<(), SemanticError>
pub fn validate_for(&self, target: Target) -> Result<(), SemanticError>
Apply the complete stable TOSA semantic pass for a device-neutral target.
Sourcepub fn analyze_for(
&self,
target: Target,
) -> Result<TosaAnalysis<'a>, AnalysisError>
pub fn analyze_for( &self, target: Target, ) -> Result<TosaAnalysis<'a>, AnalysisError>
Validate once and build a compact provider-neutral lowering plan over this borrowed model.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Model<'a>
impl<'a> RefUnwindSafe for Model<'a>
impl<'a> Send for Model<'a>
impl<'a> Sync for Model<'a>
impl<'a> Unpin for Model<'a>
impl<'a> UnsafeUnpin for Model<'a>
impl<'a> UnwindSafe for Model<'a>
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