pub trait WeightLoader {
// Required methods
fn tensor_bytes(&self, name: &str) -> Option<&[u8]>;
fn names(&self) -> Vec<String>;
}Expand description
A name-keyed view of weight tensor bytes.
Implementations promise that the returned slice stays valid for the
lifetime of &self. On native, this is the mmap region; on WASM, it
is the in-memory Vec<u8> owned by the loader.
Required Methods§
Sourcefn tensor_bytes(&self, name: &str) -> Option<&[u8]>
fn tensor_bytes(&self, name: &str) -> Option<&[u8]>
Return the raw bytes for the tensor named name, or None if not
present. Bytes are in the source file’s storage order (typically
row-major, dtype-native).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".