Enum ProtError

Source
pub enum ProtError {
    IoError(Error),
    WebError(WebError),
    Extension(&'static str),
    Timeout(TimeoutError),
    SendError,
    ServerUpgradeHttp2(Binary, Option<RecvRequest>),
    ClientUpgradeHttp2(Settings),
    ServerUpgradeWs(RecvRequest),
    ClientUpgradeWs(RecvRequest),
    GoAway(Binary, Reason, Initiator),
}

Variants§

§

IoError(Error)

标准错误库的错误类型

§

WebError(WebError)

解析库发生错误

§

Extension(&'static str)

其它错误信息

§

Timeout(TimeoutError)

§

SendError

§

ServerUpgradeHttp2(Binary, Option<RecvRequest>)

协议数据升级, 第一参数表示将要写给客户端的消息, 第二参数表示原来未处理的请求

§

ClientUpgradeHttp2(Settings)

协议数据升级, 第一参数表示将要写给客户端的消息, 第二参数表示原来未处理的请求

§

ServerUpgradeWs(RecvRequest)

协议数据升级, 保留原请求

§

ClientUpgradeWs(RecvRequest)

§

GoAway(Binary, Reason, Initiator)

发生错误或者收到关闭消息将要关闭该链接

Implementations§

Source§

impl ProtError

Source

pub fn is_timeout(&self) -> (bool, bool)

Source

pub fn is_io(&self) -> bool

Source

pub fn is_read_timeout(&self) -> (bool, bool)

Source

pub fn is_write_timeout(&self) -> (bool, bool)

Source

pub fn is_server_upgrade_http2(&self) -> bool

Source

pub fn is_server_upgrade_ws(&self) -> bool

Source

pub fn connect_timeout(val: &'static str) -> Self

Source

pub fn read_timeout(val: &'static str) -> Self

Source

pub fn write_timeout(val: &'static str) -> Self

Source

pub fn time_timeout(val: &'static str) -> Self

Source

pub fn ka_timeout(val: &'static str) -> Self

Trait Implementations§

Source§

impl Debug for ProtError

Source§

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

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

impl Display for ProtError

Source§

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

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

impl From<Error> for ProtError

Source§

fn from(value: Error) -> Self

Converts to this type from the input type.
Source§

impl<T> From<SendError<T>> for ProtError

Source§

fn from(_: SendError<T>) -> Self

Converts to this type from the input type.
Source§

impl From<WebError> for ProtError

Source§

fn from(value: WebError) -> Self

Converts to this type from the input type.
Source§

impl Send for ProtError

Source§

impl Sync for ProtError

Auto Trait Implementations§

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.

Source§

impl<T> Instrument for T

Source§

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

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

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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