pub enum TransportKind {
Abridged,
Intermediate,
Full,
Obfuscated {
secret: Option<[u8; 16]>,
},
}Expand description
Which MTProto transport framing to use for all connections.
| Variant | Init bytes | Notes |
|---|---|---|
Abridged | 0xef | Default, smallest overhead |
Intermediate | 0xeeeeeeee | Better proxy compat |
Full | none | Adds seqno + CRC32 |
Obfuscated | random 64B | Bypasses DPI / MTProxy |
Variants§
Abridged
MTProto Abridged transport — length prefix is 1 or 4 bytes.
Intermediate
MTProto Intermediate transport — 4-byte LE length prefix.
Full
MTProto Full transport — 4-byte length + seqno + CRC32.
Obfuscated
Obfuscated2 transport — XOR stream cipher over Abridged framing. Required for MTProxy and networks with deep-packet inspection.
secret is the 16-byte proxy secret, or None for keyless obfuscation.
Trait Implementations§
Source§impl Clone for TransportKind
impl Clone for TransportKind
Source§fn clone(&self) -> TransportKind
fn clone(&self) -> TransportKind
Returns a duplicate 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 TransportKind
impl Debug for TransportKind
Source§impl Default for TransportKind
impl Default for TransportKind
Source§fn default() -> TransportKind
fn default() -> TransportKind
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TransportKind
impl RefUnwindSafe for TransportKind
impl Send for TransportKind
impl Sync for TransportKind
impl Unpin for TransportKind
impl UnsafeUnpin for TransportKind
impl UnwindSafe for TransportKind
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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more