pub struct PathBroken {
pub dest_addr: NodeAddr,
pub reporter: NodeAddr,
pub last_known_coords: Option<TreeCoordinate>,
}Expand description
Error indicating routing failure (local minimum or unreachable).
Carried inside a SessionDatagram addressed back to the original source.
The reporting router creates a new SessionDatagram with src_addr=reporter
and dest_addr=original_source, so the original_src field from the old
design is no longer needed — it’s the SessionDatagram’s dest_addr.
§Wire Format
| Offset | Field | Size | Description |
|---|---|---|---|
| 0 | msg_type | 1 byte | 0x21 |
| 1 | flags | 1 byte | Reserved |
| 2 | dest_addr | 16 bytes | The unreachable node_addr |
| 18 | reporter | 16 bytes | NodeAddr of reporting router |
| 34 | last_coords_count | 2 bytes | u16 LE |
| 36 | last_known_coords | 16 × n | Stale coords that failed |
Fields§
§dest_addr: NodeAddrDestination that couldn’t be reached.
reporter: NodeAddrNode that detected the failure.
last_known_coords: Option<TreeCoordinate>Optional: last known coordinates of destination.
Implementations§
Source§impl PathBroken
impl PathBroken
Sourcepub fn with_last_coords(self, coords: TreeCoordinate) -> Self
pub fn with_last_coords(self, coords: TreeCoordinate) -> Self
Add last known coordinates.
Sourcepub fn encode(&self) -> Vec<u8> ⓘ
pub fn encode(&self) -> Vec<u8> ⓘ
Encode as wire format (4-byte FSP prefix + msg_type + body).
Error signals use phase=0x0 with U flag set.
Sourcepub fn decode(payload: &[u8]) -> Result<Self, ProtocolError>
pub fn decode(payload: &[u8]) -> Result<Self, ProtocolError>
Decode from wire format (after FSP prefix and msg_type byte consumed).
Trait Implementations§
Source§impl Clone for PathBroken
impl Clone for PathBroken
Source§fn clone(&self) -> PathBroken
fn clone(&self) -> PathBroken
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PathBroken
impl RefUnwindSafe for PathBroken
impl Send for PathBroken
impl Sync for PathBroken
impl Unpin for PathBroken
impl UnsafeUnpin for PathBroken
impl UnwindSafe for PathBroken
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more