pub struct Package { /* private fields */ }Expand description
.rlxp package types — re-exported so open_rlxp’s return type is nameable
without a direct rlx-pkg dependency.
Opened RLX package.
Implementations§
Source§impl Package
impl Package
Sourcepub fn open(path: impl AsRef<Path>) -> Result<Package, Error>
pub fn open(path: impl AsRef<Path>) -> Result<Package, Error>
Open a directory, flat .rlxp, or ZIP archive.
pub fn manifest(&self) -> &Manifest
pub fn weights_index(&self) -> Option<&WeightsIndex>
pub fn placement(&self) -> Option<&Placement>
Sourcepub fn graph(&self) -> Result<Graph, Error>
pub fn graph(&self) -> Result<Graph, Error>
Deserialize the MIR graph and fill stripped weight Constants from the
package (hot tier only by default — see MaterializeMode).
Sourcepub fn graph_with(&self, mode: MaterializeMode) -> Result<Graph, Error>
pub fn graph_with(&self, mode: MaterializeMode) -> Result<Graph, Error>
Like Self::graph with an explicit materialize mode.
Sourcepub fn bind_tensor(&self, g: &mut Graph, name: &str) -> Result<(), Error>
pub fn bind_tensor(&self, g: &mut Graph, name: &str) -> Result<(), Error>
Bind one tensor (any tier) into matching empty Constants.
Sourcepub fn bind_warm_and_cold(&self, g: &mut Graph) -> Result<(), Error>
pub fn bind_warm_and_cold(&self, g: &mut Graph) -> Result<(), Error>
Inflate all non-hot tensors into the graph (after MaterializeMode::HotOnly).
Sourcepub fn advise_hot_willneed(&self)
pub fn advise_hot_willneed(&self)
Hint the OS to prefetch hot weight pages (madvise WILLNEED). Best-effort.
Sourcepub fn prefetch_tensor(&self, name: &str) -> Result<(), Error>
pub fn prefetch_tensor(&self, name: &str) -> Result<(), Error>
Prefetch a single named tensor’s stored range.
Sourcepub fn sidecar(&self, id: &str) -> Result<Vec<u8>, Error>
pub fn sidecar(&self, id: &str) -> Result<Vec<u8>, Error>
Sidecar bytes by id (decompresses cold sidecars).
pub fn weight_entry(&self, name: &str) -> Result<&WeightEntry, Error>
Sourcepub fn tensor_bytes(&self, name: &str) -> Result<Vec<u8>, Error>
pub fn tensor_bytes(&self, name: &str) -> Result<Vec<u8>, Error>
Owned tensor bytes (decompresses warm/cold; copies hot). Uses parallel
warm-block decode for large zstd_blocks blobs.
Sourcepub fn tensor_mmap(&self, name: &str) -> Result<&[u8], Error>
pub fn tensor_mmap(&self, name: &str) -> Result<&[u8], Error>
Zero-copy mmap view — hot / raw only.
Sourcepub fn tensor_warm_block(
&self,
name: &str,
block_index: usize,
) -> Result<Vec<u8>, Error>
pub fn tensor_warm_block( &self, name: &str, block_index: usize, ) -> Result<Vec<u8>, Error>
Decode one warm block by index (0-based) without inflating the whole tensor.
pub fn tensor_f32(&self, name: &str) -> Result<Vec<f32>, Error>
pub fn tensors_for_rank(&self, rank: u32) -> Vec<&WeightEntry>
pub fn tensors_by_tier(&self, tier: StorageTier) -> Vec<&WeightEntry>
pub fn rank_root(&self, rank: u32) -> Option<String>
pub fn member_bytes(&self, rel: &str) -> Result<Vec<u8>, Error>
Auto Trait Implementations§
impl Freeze for Package
impl RefUnwindSafe for Package
impl Send for Package
impl Sync for Package
impl Unpin for Package
impl UnsafeUnpin for Package
impl UnwindSafe for Package
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more