[][src]Struct tox_packet::dht::BootstrapInfo

pub struct BootstrapInfo {
    pub version: u32,
    pub motd: Vec<u8>,
}

Sent by both client and server, only server will respond. When server receives this packet it may respond with the version of the library plus MoTD (message of the day). The max length of MoTD is 256 bytes so the max packet lenght of server BootstrapInfo is 261=(1+4+256) bytes.

Client must send a BootstrapInfo of exactly 78 bytes, the only 1 field is required: packet type which is filled automatically. So version may be filled with any value, so does MoTD, but it has to be exactly 73=(78-1-4) bytes long. The server should check that the size of the packet is exactly 78 bytes long (or MoTD=73 bytes filled with any values). Frankly speaking, there should be neither version nor motd fields in the request version, the serialized form should be 1 byte with packet type + (78-1) bytes of trash, but this implementation is simplified.

Serialized form:

LengthContents
10xF0
4Version in BigEndian
variableMoTD, must not longer than 256 bytes

Fields

version: u32

The version of DHT server

motd: Vec<u8>

Message of the day

Trait Implementations

impl Clone for BootstrapInfo[src]

impl Debug for BootstrapInfo[src]

impl Eq for BootstrapInfo[src]

impl FromBytes for BootstrapInfo[src]

impl PartialEq<BootstrapInfo> for BootstrapInfo[src]

impl StructuralEq for BootstrapInfo[src]

impl StructuralPartialEq for BootstrapInfo[src]

impl ToBytes for BootstrapInfo[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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.