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
impl MirrorBondStatesParams
Sourcepub fn effective_limit(&self) -> u32
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.
Sourcepub fn validated(self) -> Result<Self, ControlError>
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
impl Clone for MirrorBondStatesParams
Source§fn clone(&self) -> MirrorBondStatesParams
fn clone(&self) -> MirrorBondStatesParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ControlCall for MirrorBondStatesParams
impl ControlCall for MirrorBondStatesParams
Source§const METHOD: ControlMethod = ControlMethod::MirrorBondStates
const METHOD: ControlMethod = ControlMethod::MirrorBondStates
Source§type Output = MirrorBondStatesResult
type Output = MirrorBondStatesResult
Source§impl Debug for MirrorBondStatesParams
impl Debug for MirrorBondStatesParams
Source§impl Default for MirrorBondStatesParams
impl Default for MirrorBondStatesParams
Source§fn default() -> MirrorBondStatesParams
fn default() -> MirrorBondStatesParams
Source§impl<'de> Deserialize<'de> for MirrorBondStatesParams
impl<'de> Deserialize<'de> for MirrorBondStatesParams
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
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.