pub enum CommandDecodeError<'a> {
Incomplete,
LiteralFound {
tag: Tag<'a>,
length: u32,
mode: LiteralMode,
},
Failed,
}
Expand description
Error during command decoding.
Variants§
Incomplete
More data is needed.
LiteralFound
More data is needed (and further action may be necessary).
The decoder stopped at the beginning of literal data. Typically, a server MUST send a
command continuation request to agree to the receival of the remaining data. This behaviour
is different when LITERAL+/LITERAL-
is used.
§With LITERAL+/LITERAL-
When the mode
is sync, everything is the same as above.
When the mode
is non-sync, and the server advertised the LITERAL+ capability,
it MUST NOT send a command continuation request and accept the data right away.
When the mode
is non-sync, and the server advertised the LITERAL- capability,
and the literal length is smaller or equal than 4096,
it MUST NOT send a command continuation request and accept the data right away.
When the mode
is non-sync, and the server advertised the LITERAL- capability,
and the literal length is greater than 4096,
it MUST be handled as sync.
match mode {
LiteralMode::Sync => /* Same as sync. */
LiteralMode::Sync => match advertised {
Capability::LiteralPlus => /* Accept data right away. */
Capability::LiteralMinus => {
if literal_length <= 4096 {
/* Accept data right away. */
} else {
/* Same as sync. */
}
}
}
}
Fields
tag: Tag<'a>
The corresponding command (tag) to which this literal is bound.
This is required to reject literals, e.g., when their size exceeds a limit.
mode: LiteralMode
Literal mode, i.e., sync or non-sync.
Failed
Decoding failed.
Trait Implementations§
Source§impl<'a> Clone for CommandDecodeError<'a>
impl<'a> Clone for CommandDecodeError<'a>
Source§fn clone(&self) -> CommandDecodeError<'a>
fn clone(&self) -> CommandDecodeError<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'a> Debug for CommandDecodeError<'a>
impl<'a> Debug for CommandDecodeError<'a>
Source§impl<'a> IntoBoundedStatic for CommandDecodeError<'a>
impl<'a> IntoBoundedStatic for CommandDecodeError<'a>
Source§type Static = CommandDecodeError<'static>
type Static = CommandDecodeError<'static>
'static
lifetime.Source§fn into_static(self) -> Self::Static
fn into_static(self) -> Self::Static
T
into an owned T
such that T: 'static
.