Skip to main content

BudgetSplitError

Enum BudgetSplitError 

Source
pub enum BudgetSplitError {
    ChildShareExceedsCap {
        child_id: String,
        share_bps: u16,
    },
    OversubscribedSiblings {
        child_id: String,
        share_bps: u16,
        current_total_child_bps: u32,
        parent_share_bps: u16,
    },
    UnknownParent {
        parent_token_id: String,
    },
    DuplicateChild {
        child_id: String,
    },
    ReleaseShareMismatch {
        child_id: String,
        expected_share_bps: u16,
        actual_share_bps: u16,
    },
}
Expand description

Errors raised by BudgetSplit admission and release operations.

Variants§

§

ChildShareExceedsCap

The proposed child share alone exceeds the per-token cap of MAX_BUDGET_SHARE_BPS. Per-token validation usually catches this first; the registry repeats the check so a bypass cannot widen the surface.

Fields

§child_id: String

The child capability ID that was rejected.

§share_bps: u16

The proposed child share in basis points.

§

OversubscribedSiblings

Admitting this child would push the sum of sibling shares past the parent’s own share. The first sibling that hits this branch is rejected; previously admitted siblings are not retroactively evicted.

Fields

§child_id: String

The child capability ID that was rejected.

§share_bps: u16

The proposed child share in basis points.

§current_total_child_bps: u32

The sum of already-admitted siblings, in basis points.

§parent_share_bps: u16

The parent’s own share, in basis points.

§

UnknownParent

The parent token is unknown to the registry. This happens when the verifier sees a delegation chain whose root was never registered, or after a parent has been evicted.

Fields

§parent_token_id: String

The parent capability ID that was looked up.

§

DuplicateChild

The child token has already been admitted under this parent. The registry is idempotent: re-admitting the same child with the same share takes an additional holder lease on the existing edge and succeeds, but a different share is a hard failure because it would let an attacker rewrite the split after the fact.

Fields

§child_id: String

The child capability ID that was already present.

§

ReleaseShareMismatch

The release path was asked to remove a child with a different share than the one originally admitted. This is a hard failure because it means the caller is no longer unwinding the same delegation edge.

Fields

§child_id: String

The child capability ID whose admitted share differed.

§expected_share_bps: u16

The share supplied by the caller during release.

§actual_share_bps: u16

The share recorded during admission.

Trait Implementations§

Source§

impl Clone for BudgetSplitError

Source§

fn clone(&self) -> BudgetSplitError

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 Debug for BudgetSplitError

Source§

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

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

impl Display for BudgetSplitError

Source§

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

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

impl Eq for BudgetSplitError

Source§

impl From<BudgetSplitError> for CapabilityError

Source§

fn from(err: BudgetSplitError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for BudgetSplitError

Source§

fn eq(&self, other: &BudgetSplitError) -> 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 BudgetSplitError

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> Same for T

Source§

type Output = T

Should always be Self
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.