Skip to main content

ResourceEstimate

Struct ResourceEstimate 

Source
#[non_exhaustive]
pub struct ResourceEstimate { /* private fields */ }
Expand description

Predicted resources for a conversion plan. Every field is Option — fillers may model what they can and leave the rest None. wall_ms is already scaled to compute.cores() when produced by ConvertPlan::estimate_in; the internal threading-bottleneck model is in estimate_plan (docs/ESTIMATE.md). #[non_exhaustive], shape-compatible with zencodec::estimate::ResourceEstimate; build via new / unknown + the with_* setters.

Implementations§

Source§

impl ResourceEstimate

Source

pub fn unknown() -> Self

All-None estimate — for stages that don’t model their resource use.

Source

pub fn new(peak_memory_bytes_est: u64, wall_ms: u64) -> Self

Estimate from the two essentials: typical peak memory + wall time. Buffer count left None; refine with with_intermediate_buffer_count.

Source

pub fn with_intermediate_buffer_count(self, n: u32) -> Self

Full-image intermediate buffers held simultaneously, NOT counting input or output. Distinguishes 1-giant-buffer from N-medium-buffer plans for paging-pressure decisions.

Source

pub fn peak_memory_bytes_est(&self) -> Option<u64>

Typical (≈ p50) estimated peak memory, bytes.

Source

pub fn wall_ms(&self) -> Option<u64>

Predicted wall-clock ms. Already scaled to ComputeEnvironment::cores when produced by ConvertPlan::estimate_in. Rounded up, so sub-millisecond work reports Some(1) and Some(0) means genuinely zero work (empty plan / zero pixels) — schedulers summing many small conversions overestimate slightly rather than seeing a stream of zeros.

Source

pub fn intermediate_buffer_count(&self) -> Option<u32>

Full-image intermediate buffers held simultaneously (input/output excluded). None when the planner can’t determine it.

Trait Implementations§

Source§

impl Clone for ResourceEstimate

Source§

fn clone(&self) -> ResourceEstimate

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ResourceEstimate

Source§

impl Debug for ResourceEstimate

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ResourceEstimate

Source§

fn eq(&self, other: &ResourceEstimate) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ResourceEstimate

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.