pub struct OffloadPlan { /* private fields */ }Expand description
A deterministic, validated explicit offload plan.
Implementations§
Source§impl OffloadPlan
impl OffloadPlan
Sourcepub fn new(
config: OffloadConfig,
units: impl IntoIterator<Item = OffloadUnitSpec>,
) -> Result<Self, OffloadError>
pub fn new( config: OffloadConfig, units: impl IntoIterator<Item = OffloadUnitSpec>, ) -> Result<Self, OffloadError>
Validates explicit assignments and sorts them by logical identifier.
This constructor does not materialize tensors or choose assignments.
Sourcepub const fn schema_version(&self) -> u32
pub const fn schema_version(&self) -> u32
Returns the stable serialized schema version.
Sourcepub fn validate(&self) -> Result<(), OffloadError>
pub fn validate(&self) -> Result<(), OffloadError>
Revalidates every invariant represented by this plan.
Sourcepub const fn config(&self) -> OffloadConfig
pub const fn config(&self) -> OffloadConfig
Returns the configuration used to validate this plan.
Sourcepub fn units(&self) -> &[OffloadUnitSpec]
pub fn units(&self) -> &[OffloadUnitSpec]
Returns assignments in stable logical-identifier order.
Sourcepub fn unit(&self, id: &OffloadUnitId) -> Option<&OffloadUnitSpec>
pub fn unit(&self, id: &OffloadUnitId) -> Option<&OffloadUnitSpec>
Looks up a unit by its logical identifier.
Sourcepub const fn planned_bytes(&self) -> TierByteTotals
pub const fn planned_bytes(&self) -> TierByteTotals
Returns checked planned byte totals for every tier.
Trait Implementations§
Source§impl Clone for OffloadPlan
impl Clone for OffloadPlan
Source§fn clone(&self) -> OffloadPlan
fn clone(&self) -> OffloadPlan
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OffloadPlan
impl Debug for OffloadPlan
Source§impl<'de> Deserialize<'de> for OffloadPlan
impl<'de> Deserialize<'de> for OffloadPlan
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for OffloadPlan
Source§impl PartialEq for OffloadPlan
impl PartialEq for OffloadPlan
Source§impl Serialize for OffloadPlan
impl Serialize for OffloadPlan
impl StructuralPartialEq for OffloadPlan
Auto Trait Implementations§
impl Freeze for OffloadPlan
impl RefUnwindSafe for OffloadPlan
impl Send for OffloadPlan
impl Sync for OffloadPlan
impl Unpin for OffloadPlan
impl UnsafeUnpin for OffloadPlan
impl UnwindSafe for OffloadPlan
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