pub struct PredicateWire {
pub nodes: Vec<PredicateNodeWire>,
pub root_idx: u32,
}Expand description
Wire format for Predicate. Flat node table with index
references for And/Or/Not children.
Phase 5 of CAPABILITY_ENHANCEMENTS_PLAN.md. Crosses the
nRPC envelope as serde-encoded bytes (postcard for cross-binding,
JSON for debug fixtures); the substrate’s capability
announcement path is unchanged.
Build via Predicate::to_wire; rebuild via
PredicateWire::into_predicate.
Fields§
§nodes: Vec<PredicateNodeWire>Flat node table. Children always live at lower indices than their parents.
root_idx: u32Index of the root node within nodes. Always
nodes.len() - 1 for a freshly-emitted to_wire() output;
callers receiving an externally-built wire payload should
not assume that.
Implementations§
Source§impl PredicateWire
impl PredicateWire
Sourcepub fn into_predicate(self) -> Result<Predicate, PredicateWireError>
pub fn into_predicate(self) -> Result<Predicate, PredicateWireError>
Rebuild a Predicate AST from the flat wire format.
Validates structural integrity: empty tables, out-of-bounds
indices, and child-index cycles are surfaced as typed
PredicateWireError rather than panicking. A successful
rebuild is byte-equal to the input of the matching
Predicate::to_wire call.
Trait Implementations§
Source§impl Clone for PredicateWire
impl Clone for PredicateWire
Source§fn clone(&self) -> PredicateWire
fn clone(&self) -> PredicateWire
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PredicateWire
impl Debug for PredicateWire
Source§impl<'de> Deserialize<'de> for PredicateWire
impl<'de> Deserialize<'de> for PredicateWire
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>,
Source§impl PartialEq for PredicateWire
impl PartialEq for PredicateWire
Source§fn eq(&self, other: &PredicateWire) -> bool
fn eq(&self, other: &PredicateWire) -> bool
self and other values to be equal, and is used by ==.