Enum grammers_mtproto::mtp::DeserializeError
source · pub enum DeserializeError {
BadAuthKey {
got: i64,
expected: i64,
},
BadMessageId {
got: i64,
},
NegativeMessageLength {
got: i32,
},
TooLongMessageLength {
got: usize,
max_length: usize,
},
MessageBufferTooSmall,
DecompressionFailed,
UnexpectedConstructor {
id: u32,
},
DecryptionError(Error),
}
Expand description
The error type for the deserialization of server messages.
Variants§
BadAuthKey
The server’s authorization key did not match our expectations.
BadMessageId
The server’s message ID did not match our expectations.
NegativeMessageLength
The server’s message length was not strictly positive.
TooLongMessageLength
The server’s message length was past the buffer.
MessageBufferTooSmall
The received buffer is too small to contain a valid response message, or the response seemed valid at first but trying to deserialize it proved the buffer to be too small.
DecompressionFailed
The server responded with compressed data which we failed to decompress.
UnexpectedConstructor
While deserializing the response types one of them had a constructor that did not match our expectations. The invalid ID is contained within this variant.
DecryptionError(Error)
Attempting to decrypt the message failed in some way.
Trait Implementations§
source§impl Clone for DeserializeError
impl Clone for DeserializeError
source§fn clone(&self) -> DeserializeError
fn clone(&self) -> DeserializeError
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for DeserializeError
impl Debug for DeserializeError
source§impl Display for DeserializeError
impl Display for DeserializeError
source§impl Error for DeserializeError
impl Error for DeserializeError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl From<Error> for DeserializeError
impl From<Error> for DeserializeError
source§impl From<Error> for DeserializeError
impl From<Error> for DeserializeError
source§impl PartialEq for DeserializeError
impl PartialEq for DeserializeError
impl StructuralPartialEq for DeserializeError
Auto Trait Implementations§
impl Freeze for DeserializeError
impl RefUnwindSafe for DeserializeError
impl Send for DeserializeError
impl Sync for DeserializeError
impl Unpin for DeserializeError
impl UnwindSafe for DeserializeError
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)