Enum cola::DecodeError
source · pub enum DecodeError {
ChecksumFailed,
DifferentProtocol {
encoded_on: ProtocolVersion,
decoding_on: ProtocolVersion,
},
InvalidData,
}Expand description
The type of error that can occur when decodeing an
EncodedReplica.
Variants§
ChecksumFailed
This error occurs when the internal checksum of the EncodedReplica
fails.
This typically means that the EncodedReplica was corrupted during
transmission.
DifferentProtocol
Fields
encoded_on: ProtocolVersionThe ProtocolVersion of cola on the machine that created the
EncodedReplica.
decoding_on: ProtocolVersionThe ProtocolVersion of cola on the machine that is trying to
decode the EncodedReplica.
This error occurs when the machine that created the EncodedReplica
and the one that is trying to decode it are using
two incompatible versions of cola.
InvalidData
This error is an umbrella variant that encompasses all other errors
that can occur when the binary data wrapped by the EncodedReplica
cannot be decoded into a Replica.
This is returned when the checksum and protocol version checks both
succeed, and yet the data is still invalid. The only way this can
occur in practice is if the EncodedReplica passed to
decode was deserialized from a byte vector that
was not the result of serializing an EncodedReplica.
As long as you’re not doing that (and you shouldn’t be) this variant can be ignored.
Trait Implementations§
source§impl Clone for DecodeError
impl Clone for DecodeError
source§fn clone(&self) -> DecodeError
fn clone(&self) -> DecodeError
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for DecodeError
impl Debug for DecodeError
source§impl Display for DecodeError
impl Display for DecodeError
source§impl Error for DecodeError
impl Error for DecodeError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl PartialEq for DecodeError
impl PartialEq for DecodeError
source§fn eq(&self, other: &DecodeError) -> bool
fn eq(&self, other: &DecodeError) -> bool
self and other values to be equal, and is used
by ==.