Struct tor_cell::relaycell::msg::End

source ·
pub struct End { /* private fields */ }
Expand description

An End message tells the other end of the circuit to close a stream.

Note that End messages do not implement a true half-closed state, so after sending an End message each party needs to wait a while to be sure that the stream is completely dead.

Implementations§

source§

impl End

source

pub fn new_misc() -> Self

Make a new END_REASON_MISC message.

Clients send this every time they decide to close a stream.

source

pub fn new_with_reason(reason: EndReason) -> Self

Make a new END message with the provided end reason.

source

pub fn new_exitpolicy(addr: IpAddr, ttl: u32) -> Self

Make a new END message with END_REASON_EXITPOLICY, and the provided address and ttl.

source

pub fn reason(&self) -> EndReason

Return the provided EndReason for this End cell.

Trait Implementations§

source§

impl Body for End

source§

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<()>

Encode the body of this cell into the end of a writer.
source§

impl Clone for End

source§

fn clone(&self) -> End

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for End

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<End> for AnyRelayMsg

source§

fn from(m: End) -> AnyRelayMsg

Converts to this type from the input type.
source§

impl RelayMsg for End

source§

fn cmd(&self) -> RelayCmd

Return the stream command associated with this message.
source§

fn encode_onto<W: Writer + ?Sized>(self, w: &mut W) -> EncodeResult<()>

Encode the body of this message, not including command or length
source§

fn decode_from_reader(cmd: RelayCmd, r: &mut Reader<'_>) -> Result<Self>

Extract the body of a message with command cmd from reader r.
source§

impl TryFrom<AnyRelayMsg> for End

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(msg: AnyRelayMsg) -> Result<End>

Performs the conversion.

Auto Trait Implementations§

§

impl Freeze for End

§

impl RefUnwindSafe for End

§

impl Send for End

§

impl Sync for End

§

impl Unpin for End

§

impl UnwindSafe for End

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more