Skip to main content

MirrorBondStatesParams

Struct MirrorBondStatesParams 

Source
pub struct MirrorBondStatesParams {
    pub after: Option<MirrorBondKey>,
    pub limit: Option<u32>,
}
Expand description

control.mirror.bondStates params — one page of this node’s mirror bond states.

§The caller narrows nothing

There is no store filter. The answer is this node’s OWN bond set, and both consuming surfaces (dig-app#300’s pane, dig-app#289’s locked total) want all of it; a client wanting one store filters the page it was handed. Adding a filter would also make locked_dig_base_units — a whole-set figure — read as a filtered one, which is the money lie this method is built to avoid.

§Paged, and the page boundary is the caller’s

Rows come in ascending (store_id, root) and a caller resumes from after — the key of the last row it was actually HANDED. An out-of-range limit is REFUSED rather than clamped, matching WalletCoinsByParentParams and for the same reason: a silently shrunk page hands back a cursor for a position the caller did not ask about.

Fields§

§after: Option<MirrorBondKey>

Resume STRICTLY AFTER this (store_id, root), in ascending key order. None starts at the first bond.

The value the previous page handed back as cursor — never a key the caller kept for another reason. Resuming by store_id alone would drop every remaining root of the store the boundary fell inside.

Both halves are LOWERCASE 64-hex, unprefixed, and a 0x prefix is tolerated on input and normalized away by validated. Anything else is REFUSED — see there for why a malformed cursor must never be read as “start from the beginning”.

§limit: Option<u32>

The page size. None asks for MIRROR_BOND_STATES_DEFAULT_LIMIT.

A zero, or a value above MIRROR_BOND_STATES_MAX_LIMIT, is REFUSED as INVALID_PARAMS rather than clamped — see Self::validated.

Implementations§

Source§

impl MirrorBondStatesParams

Source

pub fn effective_limit(&self) -> u32

The page size this request asks for, resolving None to MIRROR_BOND_STATES_DEFAULT_LIMIT.

Stated once here so the node and the client cannot resolve the same omitted field to two different numbers.

Source

pub fn validated(self) -> Result<Self, ControlError>

Check the page bound, or reject as -32602 INVALID_PARAMS.

limit: 0 is refused because a page that can hold nothing makes no progress: a caller looping until complete would loop forever. A limit above the cap is refused rather than clamped so the caller’s model of the page and the node’s stay identical.

after is normalized on the same terms as every other hex id in this crate (WalletCoinsParams::validated) and a malformed one is REFUSED rather than dropped. That refusal is the point: this order is ascending over the key’s STRING form, so a 0x-prefixed key sorts before every canonical one and a node that quietly ignored it would RESTART the walk while looking like it resumed. On the surface a locked-$DIG total is summed from, a silently repeated page is wrong in the reassuring direction, and it is indistinguishable from a correct answer. Coercing an unparseable cursor to start-of-set is the same defect by another route, and it would contradict this method’s own refuse-don’t-clamp rule for limit.

Trait Implementations§

Source§

impl Clone for MirrorBondStatesParams

Source§

fn clone(&self) -> MirrorBondStatesParams

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 ControlCall for MirrorBondStatesParams

Source§

const METHOD: ControlMethod = ControlMethod::MirrorBondStates

The wire method this call invokes.
Source§

type Output = MirrorBondStatesResult

The typed result this call returns on success.
Source§

impl Debug for MirrorBondStatesParams

Source§

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

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

impl Default for MirrorBondStatesParams

Source§

fn default() -> MirrorBondStatesParams

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for MirrorBondStatesParams

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Validates on the way in, so a node cannot forget to call Self::validated.

Source§

impl Eq for MirrorBondStatesParams

Source§

impl PartialEq for MirrorBondStatesParams

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl Serialize for MirrorBondStatesParams

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for MirrorBondStatesParams

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.