pub struct MtuExceeded {
pub dest_addr: NodeAddr,
pub reporter: NodeAddr,
pub mtu: u16,
}Expand description
Error indicating a forwarded packet exceeded the next-hop transport MTU.
Generated by a transit router when send_encrypted_link_message()
fails with TransportError::MtuExceeded. The reporter includes the
bottleneck MTU so the source can immediately reduce its sending MTU.
§Wire Format
| Offset | Field | Size | Description |
|---|---|---|---|
| 0 | msg_type | 1 byte | 0x22 |
| 1 | flags | 1 byte | Reserved |
| 2 | dest_addr | 16 bytes | The destination we were forwarding |
| 18 | reporter | 16 bytes | NodeAddr of reporting router |
| 34 | mtu | 2 bytes | Bottleneck MTU (u16 LE) |
Payload: 36 bytes
Fields§
§dest_addr: NodeAddrDestination that the oversized packet was heading to.
reporter: NodeAddrRouter that detected the MTU violation.
mtu: u16Transport MTU at the bottleneck hop.
Implementations§
Source§impl MtuExceeded
impl MtuExceeded
Sourcepub fn new(dest_addr: NodeAddr, reporter: NodeAddr, mtu: u16) -> Self
pub fn new(dest_addr: NodeAddr, reporter: NodeAddr, mtu: u16) -> Self
Create a new MtuExceeded error.
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 MtuExceeded
impl Clone for MtuExceeded
Source§fn clone(&self) -> MtuExceeded
fn clone(&self) -> MtuExceeded
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 MtuExceeded
impl RefUnwindSafe for MtuExceeded
impl Send for MtuExceeded
impl Sync for MtuExceeded
impl Unpin for MtuExceeded
impl UnsafeUnpin for MtuExceeded
impl UnwindSafe for MtuExceeded
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