pub struct WireError {
pub code: KernelErrorCode,
pub message: String,
pub fatal: bool,
}Expand description
A refusal on the wire, already carrying the code it will be sent as.
Same shape as crate::project::Refusal and deliberately separate: that
one answers a COMMAND and can be turned into a KernelResult, while this
one can also mean the connection itself is unusable — an I/O failure or a
budget exhausted mid-frame has no request to answer.
Fields§
§code: KernelErrorCode§message: String§fatal: boolTrue when the connection cannot continue: the framing is out of step, or the transport failed. A refusal that only concerns one request leaves this false and the connection open.
Implementations§
Source§impl WireError
impl WireError
pub fn new(code: KernelErrorCode, message: impl Into<String>) -> Self
pub fn io(what: &str, error: Error) -> Self
Sourcepub fn into_result(self) -> KernelResult
pub fn into_result(self) -> KernelResult
The value form, for the one case where a refusal still owes a response.
Trait Implementations§
Source§impl Error for WireError
impl Error for WireError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for WireError
impl RefUnwindSafe for WireError
impl Send for WireError
impl Sync for WireError
impl Unpin for WireError
impl UnsafeUnpin for WireError
impl UnwindSafe for WireError
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> 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