Skip to main content

StatusCode

Enum StatusCode 

Source
#[repr(u16)]
pub enum StatusCode {
Show 14 variants LengthTooLarge = 18, LengthTooShort = 19, LengthMismatch = 20, LengthRequired = 21, BadMessageContents = 22, BadBlockCounter = 23, UnexpectedMessage = 24, ResponderBusy = 25, TransferFailedUnknownError = 31, TransferMethodNotSupported = 80, FileDesignatorUnknown = 81, StartOffsetNotSupported = 82, VersionNotSupported = 83, Unknown = 95,
}
Expand description

§11.22.3.2’s status codes, as they appear in a StatusReport’s ProtocolCode field.

Exhaustive: the specification closes the set.

Variants§

§

LengthTooLarge = 18

“Definite length too large to support. For example, trying to SendInit with too large of a file.”

§

LengthTooShort = 19

“Definite length proposed for transfer is too short for the context based on the responder’s knowledge of expected size.”

§

LengthMismatch = 20

“Pre-negotiated size of transfer was not fulfilled prior to BlockAckEOF.”

§

LengthRequired = 21

“Responder can only support proposed transfer if definite length is provided.”

§

BadMessageContents = 22

“Received a malformed protocol message.”

§

BadBlockCounter = 23

“Received block counter out of order from expectation.”

§

UnexpectedMessage = 24

“Received a well-formed message that was contextually inappropriate for the current state of the transfer.”

§

ResponderBusy = 25

“Responder is too busy to proceed with a new transfer at this moment.” An Initiator “SHOULD wait at least 60 seconds” before trying again.

§

TransferFailedUnknownError = 31

“Other error occurred, such as perhaps an input/output error occurring at one of the peers.”

§

TransferMethodNotSupported = 80

“Received a message that mismatches the current transfer mode.”

§

FileDesignatorUnknown = 81

“Attempted to request a file whose designator is unknown to the responder.”

§

StartOffsetNotSupported = 82

“Proposed transfer with explicit start offset is not supported in current context.”

§

VersionNotSupported = 83

“Could not find a common supported version between initiator and responder.”

§

Unknown = 95

“Other unexpected error.”

Implementations§

Source§

impl StatusCode

Source

pub const fn value(self) -> u16

The wire value.

Source

pub const fn from_u16(value: u16) -> Self

Reads a ProtocolCode from a StatusReport that named the BDX protocol.

An unrecognised code becomes Unknown rather than an error: §11.22.3.2 says “any other unexpected StatusReport” ends the transfer just the same, so the one thing a caller must not do is keep going because it could not read the reason.

Trait Implementations§

Source§

impl Clone for StatusCode

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for StatusCode

Source§

impl Debug for StatusCode

Source§

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

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

impl Eq for StatusCode

Source§

impl From<StatusCode> for Error

Source§

fn from(_: StatusCode) -> Self

For a caller that has to hand a BDX failure back through the crate’s own error type — the transfer is over either way.

Source§

impl Hash for StatusCode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for StatusCode

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for StatusCode

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.