pub struct Truncated { /* private fields */ }Expand description
A Truncated message is sent to the client when the remaining hops of a circuit have gone away.
NOTE: Current Tor implementations often treat Truncated messages and Destroy messages interchangeably. Truncated was intended to be a “soft” Destroy, that would leave the unaffected parts of a circuit still usable.
Implementations§
source§impl Truncated
impl Truncated
sourcepub fn new(reason: DestroyReason) -> Self
pub fn new(reason: DestroyReason) -> Self
Construct a new truncated message.
sourcepub fn reason(self) -> DestroyReason
pub fn reason(self) -> DestroyReason
Get the provided reason to truncate the circuit.
Trait Implementations§
source§impl Body for Truncated
impl Body for Truncated
source§fn decode_from_reader(r: &mut Reader<'_>) -> Result<Self>
fn decode_from_reader(r: &mut Reader<'_>) -> Result<Self>
Decode a relay cell body from a provided reader.
source§fn encode_onto<W: Writer + ?Sized>(self, w: &mut W) -> EncodeResult<()>
fn encode_onto<W: Writer + ?Sized>(self, w: &mut W) -> EncodeResult<()>
Encode the body of this cell into the end of a writer.
source§impl From<Truncated> for AnyRelayMsg
impl From<Truncated> for AnyRelayMsg
source§fn from(m: Truncated) -> AnyRelayMsg
fn from(m: Truncated) -> AnyRelayMsg
Converts to this type from the input type.