[][src]Struct zenoh_protocol::proto::Open

pub struct Open {
    pub version: u8,
    pub whatami: WhatAmI,
    pub pid: PeerId,
    pub lease: ZInt,
    pub initial_sn: ZInt,
    pub sn_resolution: Option<ZInt>,
    pub locators: Option<Vec<Locator>>,
}

NOTE: 16 bits (2 bytes) may be prepended to the serialized message indicating the total lenght in bytes of the message, resulting in the maximum lenght of a message being 65_536 bytes. This is necessary in those stream-oriented transports (e.g., TCP) that do not preserve the boundary of the serialized messages. The length is encoded as little-endian. In any case, the lenght of a message must not exceed 65_535 bytes.

The OPEN message is sent on a specific Locator to initiate a session with the peer associated with that Locator.

7 6 5 4 3 2 1 0 +-+-+-+-+-+-+-+-+ |X|X|O| OPEN | +-+-+-+-+-------+ | v_maj | v_min | -- Protocol Version VMaj.VMin +-------+-------+ ~ whatami ~ -- E.g., client, router, peer or a combination of them +---------------+ ~ o_peer_id ~ -- PID of the sender of the OPEN +---------------+ ~ lease_period ~ -- Lease period of the session +---------------+ ~ initial_sn ~ -- Initial SN proposed by the sender of the OPEN(*) +-+-+-+-+-+-+-+-+ |L|S|X|X|X|X|X|X| if O==1 +-+-+-+-+-+-+-+-+ ~ sn_resolution ~ if S==1 -- Otherwise 2^28 is assumed(**) +---------------+ ~ Locators ~ if L==1 -- List of locators the sender of the OPEN is reachable at +---------------+

(*) The Initial SN must be bound to the proposed SN Resolution. Otherwise the OPEN message is consmsg::idered invalid and it should be discarded by the recipient of the OPEN message. (**) In case of the Accepter Peer negotiates a smaller SN Resolution (see ACCEPT message) and the proposed Initial SN results to be out-of-bound, the new Agreed Initial SN is calculated according to the following modulo operation: Agreed Initial SN := (Initial SN_Open) mod (SN Resolution_Accept)

Fields

version: u8whatami: WhatAmIpid: PeerIdlease: ZIntinitial_sn: ZIntsn_resolution: Option<ZInt>locators: Option<Vec<Locator>>

Trait Implementations

impl Clone for Open[src]

impl Debug for Open[src]

impl PartialEq<Open> for Open[src]

impl StructuralPartialEq for Open[src]

Auto Trait Implementations

impl RefUnwindSafe for Open

impl Send for Open

impl Sync for Open

impl Unpin for Open

impl UnwindSafe for Open

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> Same<T> for T

type Output = T

Should always be Self

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,