pub trait TlWrite {
const TL_WRITE_BOXED: bool;
fn max_size_hint(&self) -> usize;
fn write_to<P>(&self, packet: &mut P)
where
P: TlPacket;
}Expand description
Specifies how this type can be written to the packet
Required Associated Constants
const TL_WRITE_BOXED: bool
Required Methods
fn max_size_hint(&self) -> usize
fn max_size_hint(&self) -> usize
Max required number of bytes
Implementations on Foreign Types
sourceimpl<T> TlWrite for Option<T> where
T: TlWrite,
impl<T> TlWrite for Option<T> where
T: TlWrite,
Skips serialization if None, serializes as T otherwise
const TL_WRITE_BOXED: bool = false
fn max_size_hint(&self) -> usize
fn write_to<P>(&self, packet: &mut P) where
P: TlPacket,
sourceimpl TlWrite for bool
impl TlWrite for bool
const TL_WRITE_BOXED: bool = true
fn max_size_hint(&self) -> usize
fn write_to<T>(&self, packet: &mut T) where
T: TlPacket,
sourceimpl TlWrite for u32
impl TlWrite for u32
const TL_WRITE_BOXED: bool = false
fn max_size_hint(&self) -> usize
fn write_to<T>(&self, packet: &mut T) where
T: TlPacket,
sourceimpl TlWrite for i32
impl TlWrite for i32
const TL_WRITE_BOXED: bool = false
fn max_size_hint(&self) -> usize
fn write_to<T>(&self, packet: &mut T) where
T: TlPacket,
sourceimpl TlWrite for u64
impl TlWrite for u64
const TL_WRITE_BOXED: bool = false
fn max_size_hint(&self) -> usize
fn write_to<T>(&self, packet: &mut T) where
T: TlPacket,
sourceimpl TlWrite for i64
impl TlWrite for i64
const TL_WRITE_BOXED: bool = false
fn max_size_hint(&self) -> usize
fn write_to<T>(&self, packet: &mut T) where
T: TlPacket,
sourceimpl TlWrite for f64
impl TlWrite for f64
const TL_WRITE_BOXED: bool = false
fn max_size_hint(&self) -> usize
fn write_to<T>(&self, packet: &mut T) where
T: TlPacket,
sourceimpl TlWrite for &[u8]
impl TlWrite for &[u8]
ton::bytes - 1 or 4 bytes of len, then len bytes of data (aligned to 4)
const TL_WRITE_BOXED: bool = false
fn max_size_hint(&self) -> usize
fn write_to<P>(&self, packet: &mut P) where
P: TlPacket,
sourceimpl TlWrite for Vec<u8>
impl TlWrite for Vec<u8>
ton::bytes - 1 or 4 bytes of len, then len bytes of data (aligned to 4)
const TL_WRITE_BOXED: bool = false
fn max_size_hint(&self) -> usize
fn write_to<P>(&self, packet: &mut P) where
P: TlPacket,
sourceimpl<const N: usize> TlWrite for [u8; N]
impl<const N: usize> TlWrite for [u8; N]
ton::int128 | ton::int256 - N bytes of data
const TL_WRITE_BOXED: bool = false
fn max_size_hint(&self) -> usize
fn write_to<P>(&self, packet: &mut P) where
P: TlPacket,
sourceimpl<T> TlWrite for Vec<T> where
T: TlWrite,
impl<T> TlWrite for Vec<T> where
T: TlWrite,
ton::vector - 4 bytes of len, then len items
const TL_WRITE_BOXED: bool = false
fn max_size_hint(&self) -> usize
fn write_to<P>(&self, packet: &mut P) where
P: TlPacket,
sourceimpl<T> TlWrite for &[T] where
T: TlWrite,
impl<T> TlWrite for &[T] where
T: TlWrite,
ton::vector - 4 bytes of len, then len items
const TL_WRITE_BOXED: bool = false
fn max_size_hint(&self) -> usize
fn write_to<P>(&self, packet: &mut P) where
P: TlPacket,
sourceimpl<T, const N: usize> TlWrite for SmallVec<[T; N]> where
[T; N]: Array,
<[T; N] as Array>::Item: TlWrite,
impl<T, const N: usize> TlWrite for SmallVec<[T; N]> where
[T; N]: Array,
<[T; N] as Array>::Item: TlWrite,
ton::vector - 4 bytes of len, then len items