[−][src]Struct tox_packet::dht::BootstrapInfo
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:
Length | Contents |
---|---|
1 | 0xF0 |
4 | Version in BigEndian |
variable | MoTD, 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]
pub fn clone(&self) -> BootstrapInfo
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for BootstrapInfo
[src]
impl Eq for BootstrapInfo
[src]
impl FromBytes for BootstrapInfo
[src]
impl PartialEq<BootstrapInfo> for BootstrapInfo
[src]
pub fn eq(&self, other: &BootstrapInfo) -> bool
[src]
pub fn ne(&self, other: &BootstrapInfo) -> bool
[src]
impl StructuralEq for BootstrapInfo
[src]
impl StructuralPartialEq for BootstrapInfo
[src]
impl ToBytes for BootstrapInfo
[src]
Auto Trait Implementations
impl RefUnwindSafe for BootstrapInfo
[src]
impl Send for BootstrapInfo
[src]
impl Sync for BootstrapInfo
[src]
impl Unpin for BootstrapInfo
[src]
impl UnwindSafe for BootstrapInfo
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,