#[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
impl StatusCode
Sourcepub const fn from_u16(value: u16) -> Self
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
impl Clone for StatusCode
impl Copy for StatusCode
Source§impl Debug for StatusCode
impl Debug for StatusCode
impl Eq for StatusCode
Source§impl From<StatusCode> for Error
impl From<StatusCode> for Error
Source§fn from(_: StatusCode) -> Self
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.