Skip to main content

ErrorWithAlert

Struct ErrorWithAlert 

Source
pub struct ErrorWithAlert<'a> {
    pub error: Error,
    /* private fields */
}
Expand description

An Error along with the (possibly encrypted) alert to send to the peer.

This borrows the output buffer passed to the operation that failed; the alert (if one is to be sent) has been appended to that buffer.

Fields§

§error: Error

The error

Implementations§

Source§

impl<'a> ErrorWithAlert<'a>

Source

pub fn tls(&self) -> &[u8]

Yields remaining TLS data, if any, to send to the peer.

The returned slice is the contents of the output buffer passed to the failed operation: the alert (if one is to be sent) and any TLS data generated before the error. Send it to the peer before closing the connection.

Trait Implementations§

Source§

impl Debug for ErrorWithAlert<'_>

Source§

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

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

impl Deref for ErrorWithAlert<'_>

Source§

type Target = Error

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for ErrorWithAlert<'a>

§

impl<'a> !UnwindSafe for ErrorWithAlert<'a>

§

impl<'a> Freeze for ErrorWithAlert<'a>

§

impl<'a> Send for ErrorWithAlert<'a>

§

impl<'a> Sync for ErrorWithAlert<'a>

§

impl<'a> Unpin for ErrorWithAlert<'a>

§

impl<'a> UnsafeUnpin for ErrorWithAlert<'a>

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

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

Source§

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>,

Source§

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