pub struct Model { /* private fields */ }Expand description
Model is a wrapper around the LiteRtModel C struct.
Usually represents a model loaded from a file.
Implementations§
Source§impl Model
impl Model
Sourcepub fn create_model_from_file(path: &str) -> Result<Self, Error>
pub fn create_model_from_file(path: &str) -> Result<Self, Error>
Creates a model from a file path.
Sourcepub fn create_model_from_buffer(buffer: &mut [u8]) -> Result<Self, Error>
pub fn create_model_from_buffer(buffer: &mut [u8]) -> Result<Self, Error>
Creates a model from a memory buffer.
Sourcepub fn num_subgraphs(&self) -> Result<usize, Error>
pub fn num_subgraphs(&self) -> Result<usize, Error>
Returns the number of subgraphs in the model.
Sourcepub fn num_signatures(&self) -> Result<usize, Error>
pub fn num_signatures(&self) -> Result<usize, Error>
Returns the number of signatures in the model.
Sourcepub fn signatures(&self) -> Result<SignatureIterator<'_>, Error>
pub fn signatures(&self) -> Result<SignatureIterator<'_>, Error>
Returns an iterator over the signatures of the model.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Model
impl RefUnwindSafe for Model
impl !Send for Model
impl !Sync for Model
impl Unpin for Model
impl UnsafeUnpin for Model
impl UnwindSafe for Model
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