pub enum JsonTreeMutateError<R, Q, E>{
InputBudget(MeasuredBudgetError<R, Q>),
Visitor(E),
OutputBudget(MeasuredBudgetError<R, Q>),
}Expand description
Identifies the phase that failed during a budget-aware JSON tree mutation.
Input and output budgets are deliberately separate so callers can decide which transaction, if any, remains eligible for commit after a failure.
§Type Parameters
R- Resource identity attached to budget failures.Q- Quantity representation attached to budget failures.E- Error type returned by the mutation visitor.
§Examples
use qubit_json::value::traverse::JsonTreeMutateError;
let error: JsonTreeMutateError<(), usize, &str> =
JsonTreeMutateError::Visitor("mutation rejected");
assert!(matches!(error, JsonTreeMutateError::Visitor(_)));Variants§
InputBudget(MeasuredBudgetError<R, Q>)
The complete tree before mutation exceeded its input budget.
Tuple Fields
§
0: MeasuredBudgetError<R, Q>Resource measurement for the original tree.
Visitor(E)
The caller-defined visitor failed after mutation began.
Tuple Fields
§
0: EDomain error returned after the visitor began mutating the tree.
OutputBudget(MeasuredBudgetError<R, Q>)
The complete tree after mutation exceeded its output budget.
Tuple Fields
§
0: MeasuredBudgetError<R, Q>Resource measurement for the mutated tree.
Trait Implementations§
Source§impl<R, Q, E> Display for JsonTreeMutateError<R, Q, E>
impl<R, Q, E> Display for JsonTreeMutateError<R, Q, E>
Source§impl<R, Q, E> Error for JsonTreeMutateError<R, Q, E>
impl<R, Q, E> Error for JsonTreeMutateError<R, Q, E>
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl<R, Q, E> Freeze for JsonTreeMutateError<R, Q, E>
impl<R, Q, E> RefUnwindSafe for JsonTreeMutateError<R, Q, E>
impl<R, Q, E> Send for JsonTreeMutateError<R, Q, E>
impl<R, Q, E> Sync for JsonTreeMutateError<R, Q, E>
impl<R, Q, E> Unpin for JsonTreeMutateError<R, Q, E>
impl<R, Q, E> UnsafeUnpin for JsonTreeMutateError<R, Q, E>
impl<R, Q, E> UnwindSafe for JsonTreeMutateError<R, Q, E>
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