pub trait TlWrite {
type Repr: Repr;
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 Types
Required Methods
sourcefn max_size_hint(&self) -> usize
fn max_size_hint(&self) -> usize
Max required number of bytes
fn write_to<P>(&self, packet: &mut P)where
P: TlPacket,
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
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)
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