pub enum DecodeError {
ChecksumFailed,
DifferentProtocol {
encoded_on: ProtocolVersion,
decoding_on: ProtocolVersion,
},
InvalidData,
}encode only.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
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.
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.
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 more