Skip to main content

Package

Struct Package 

Source
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

Source

pub fn open(path: impl AsRef<Path>) -> Result<Package, Error>

Open a directory, flat .rlxp, or ZIP archive.

Source

pub fn manifest(&self) -> &Manifest

Source

pub fn weights_index(&self) -> Option<&WeightsIndex>

Source

pub fn placement(&self) -> Option<&Placement>

Source

pub fn has_graph(&self) -> bool

True when the package embeds a MIR graph (encoding != "none").

Source

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).

Source

pub fn graph_with(&self, mode: MaterializeMode) -> Result<Graph, Error>

Like Self::graph with an explicit materialize mode.

Source

pub fn bind_tensor(&self, g: &mut Graph, name: &str) -> Result<(), Error>

Bind one tensor (any tier) into matching empty Constants.

Source

pub fn bind_warm_and_cold(&self, g: &mut Graph) -> Result<(), Error>

Inflate all non-hot tensors into the graph (after MaterializeMode::HotOnly).

Source

pub fn advise_hot_willneed(&self)

Hint the OS to prefetch hot weight pages (madvise WILLNEED). Best-effort.

Source

pub fn prefetch_tensor(&self, name: &str) -> Result<(), Error>

Prefetch a single named tensor’s stored range.

Source

pub fn sidecar(&self, id: &str) -> Result<Vec<u8>, Error>

Sidecar bytes by id (decompresses cold sidecars).

Source

pub fn weight_entry(&self, name: &str) -> Result<&WeightEntry, Error>

Source

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.

Source

pub fn tensor_mmap(&self, name: &str) -> Result<&[u8], Error>

Zero-copy mmap view — hot / raw only.

Source

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.

Source

pub fn tensor_f32(&self, name: &str) -> Result<Vec<f32>, Error>

Source

pub fn tensors_for_rank(&self, rank: u32) -> Vec<&WeightEntry>

Source

pub fn tensors_by_tier(&self, tier: StorageTier) -> Vec<&WeightEntry>

Source

pub fn rank_root(&self, rank: u32) -> Option<String>

Source

pub fn member_bytes(&self, rel: &str) -> Result<Vec<u8>, Error>

Source§

impl Package

Source

pub fn typed_weight_bindings( &self, ) -> Result<Vec<(String, Vec<u8>, DType)>, Error>

Yield (name, bytes, dtype) for every weight — used to CompiledGraph::set_param_typed after compile (Param path).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,