fn serialize(&self, buf: Buffer) {
        let len = if self.len() <= 253 {
            buf.push(self.len() as u8);
            self.len() + 1
        } else {
            buf.extend(&[
                254,
                (self.len() & 0xff) as u8,
                ((self.len() >> 8) & 0xff) as u8,
                ((self.len() >> 16) & 0xff) as u8,
            ]);
            self.len()
        };
        let padding = (4 - (len % 4)) % 4;

        buf.extend(*self);
        (0..padding).for_each(|_| buf.push(0));
    }
/// Serializes a byte-string according to the following definition:
///
/// * `string ? = String;`.
///
/// # Examples
///
/// ```
/// use grammers_tl_types::Serializable;
///
/// assert_eq!((&[0x7f_u8][..]).to_bytes(), &[0x01, 0x7f, 0x00, 0x00]);
/// ```
Serializes a byte-string according to the following definition:
`string .
Serializes a byte - string according to the following definition : ` string .
fn serialize(&self, buf: Buffer) {
        let len = if self.len() <= 253 {
            buf.push(self.len() as u8);
            self.len() + 1
        } else {
            buf.extend(&[
                254,
                (self.len() & 0xff) as u8,
                ((self.len() >> 8) & 0xff) as u8,
                ((self.len() >> 16) & 0xff) as u8,
            ]);
            self.len()
        };
        let padding = (4 - (len % 4)) % 4;
        buf.extend(*self);
        (0..padding).for_each(|_| buf.push(0));
    }
fn serialize ( & self , buf : Buffer ) { let len = if self . len ( ) <= 253 { buf . push ( self . len ( ) as u8 ) ; self . len ( ) + 1 } else { buf . extend ( & [ 254 , ( self . len ( ) & 0xff ) as u8 , ( ( self . len ( ) >> 8 ) & 0xff ) as u8 , ( ( self . len ( ) >> 16 ) & 0xff ) as u8 , ] ) ; self . len ( ) } ; let padding = ( 4 - ( len % 4 ) ) % 4 ; buf . extend ( * self ) ; ( 0 .. padding ) . for_each ( | _ | buf . push ( 0 ) ) ; }
Serializes a byte-string according to the following definition:
 `string ?
Serializes a byte - string according to the following definition : ` string ?
&self
buf
Buffer
&self
buf
Buffer
examples
```
use grammers_tl_types::Serializable.


` ` ` use grammers_tl_types :: Serializable .