Skip to main content

CellError

Trait CellError 

Source
pub trait CellError: Send + Sync {
    // Required methods
    fn is_transient(&self) -> bool;
    fn is_meter_refusal(&self) -> bool;
    fn heap_bytes(&self) -> u64;
    fn work_refused(limit: LimitError) -> Self
       where Self: Sized;
}
Expand description

What a cell must know about an error before it keeps it.

Required Methods§

Source

fn is_transient(&self) -> bool

Whether the error depends on more than the input: a budget or meter refusal (crate::LimitKind::InputMemory), an I/O failure, a provider’s failure. Such an error is returned, never published.

Source

fn is_meter_refusal(&self) -> bool

Whether the error is the input’s own meter refusing a charge (crate::LimitKind::InputMemory), and not the budget, I/O or a provider: what a computation that ends in it was granted counts as its open’s work (module docs).

Source

fn heap_bytes(&self) -> u64

The heap the error owns (crate::limits::heap_cost of each Arc and string it holds, counted whether or not a string shares a file’s buffer), charged to the input’s meter while a cell keeps it. A clone shares that heap and allocates nothing.

Source

fn work_refused(limit: LimitError) -> Self
where Self: Sized,

The error for an ask refused because its open’s work has passed its allowance (limit is a crate::LimitKind::DecodeWork refusal): not transient, so the cell keeps it (module docs).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§