pub struct OriginTrail { /* private fields */ }Expand description
The derivation walk from producing material toward one generated unit.
Edges are held in walk order, and there is always at least one of them.
Implementations§
Source§impl OriginTrail
impl OriginTrail
Sourcepub fn encode_into(&self, into: &mut Vec<u8>)
pub fn encode_into(&self, into: &mut Vec<u8>)
Appends this trail’s canonical bytes: the edge count, then every edge in walk order.
Source§impl OriginTrail
impl OriginTrail
Sourcepub fn from_edge(edge: OriginEdge) -> Self
pub fn from_edge(edge: OriginEdge) -> Self
The one-edge trail, for a unit whose origin is a single act.
Sourcepub fn drawn(offered: Vec<OriginEdge>) -> Result<Self, TrailError>
pub fn drawn(offered: Vec<OriginEdge>) -> Result<Self, TrailError>
Draws the walk these edges make, in the order they are offered.
§Errors
The two questions are dependent, and continuity is settled first: the ceiling is a fact about how long a WALK may be, so measuring a sequence that is not one would be measuring the wrong thing.
Returns TrailError::Discontinuous naming the first edge that does not start where its predecessor ended, then TrailError::Empty or TrailError::Overflow when a joined walk does not fit the trail.
A walk that does not fit refuses rather than truncating, because a truncated walk is how an origin silently becomes a span.
Sourcepub fn first(&self) -> &OriginEdge
pub fn first(&self) -> &OriginEdge
The edge the walk starts at, which every trail has.
Sourcepub fn edges(&self) -> &NonEmpty<OriginEdge, ORIGIN_EDGE_LIMIT>
pub fn edges(&self) -> &NonEmpty<OriginEdge, ORIGIN_EDGE_LIMIT>
The edges, in the order the trail walks them.
§Ordering
Walk order is the trail’s own meaning — it is the derivation path from producing material toward the generated unit — so an identity may be derived from it.
Trait Implementations§
Source§impl Clone for OriginTrail
impl Clone for OriginTrail
Source§fn clone(&self) -> OriginTrail
fn clone(&self) -> OriginTrail
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more