[][src]Enum grammers_mtproto::errors::DeserializeError

pub enum DeserializeError {
    BadAuthKey {
        got: i64,
        expected: i64,
    },
    BadMessageId {
        got: i64,
    },
    NegativeMessageLength {
        got: i32,
    },
    TooLongMessageLength {
        got: usize,
        max_length: usize,
    },
    TransportError {
        code: i32,
    },
    MessageBufferTooSmall,
    DecompressionFailed,
    UnexpectedConstructor {
        id: u32,
    },
    DecryptionError(DecryptionError),
}

The error type for the deserialization of server messages.

Variants

BadAuthKey

The server's authorization key did not match our expectations.

Fields of BadAuthKey

got: i64expected: i64
BadMessageId

The server's message ID did not match our expectations.

Fields of BadMessageId

got: i64
NegativeMessageLength

The server's message length was not strictly positive.

Fields of NegativeMessageLength

got: i32
TooLongMessageLength

The server's message length was past the buffer.

Fields of TooLongMessageLength

got: usizemax_length: usize
TransportError

The error occured at the transport level, making it impossible to deserialize any data. The absolute value indicates the HTTP error code. Some known, possible codes are:

  • 404, if the authorization key used was not found, meaning that the server is not aware of the key used by the client, so it cannot be used to securely communicate with it.

  • 429, if too many transport connections are established to the same IP address in a too-short lapse of time.

Fields of TransportError

code: i32
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.

Fields of UnexpectedConstructor

id: u32
DecryptionError(DecryptionError)

Attempting to decrypt the message failed in some way.

Trait Implementations

impl Clone for DeserializeError[src]

impl Copy for DeserializeError[src]

impl Debug for DeserializeError[src]

impl Display for DeserializeError[src]

impl Error for DeserializeError[src]

impl From<DecryptionError> for DeserializeError[src]

impl From<DeserializeError> for DeserializeError[src]

impl From<DeserializeError> for RequestError[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.