Struct zenoh_protocol::proto::Close[][src]

pub struct Close {
    pub pid: Option<PeerId>,
    pub reason: u8,
    pub link_only: bool,
}

Close message

NOTE: 16 bits (2 bytes) may be prepended to the serialized message indicating the total length
      in bytes of the message, resulting in the maximum length of a message being 65_535 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 length of a message must not exceed 65_535 bytes.

The CLOSE message is sent in any of the following two cases:
    1) in response to an OPEN message which is not accepted;
    2) at any time to arbitrarly close the session with the corresponding peer.

 7 6 5 4 3 2 1 0
+-+-+-+-+-+-+-+-+
|X|K|I|  CLOSE  |
+-+-+-+-+-------+
~    peer_id    ~  if I==1 -- PID of the target peer.
+---------------+
|     reason    |
+---------------+

- if K==0 then close the whole zenoh session.
- if K==1 then close the transport link the CLOSE message was sent on (e.g., TCP socket) but
          keep the whole session open. NOTE: the session will be automatically closed when
          the session's lease period expires.

Fields

pid: Option<PeerId>reason: u8link_only: bool

Trait Implementations

impl Clone for Close[src]

impl Debug for Close[src]

impl PartialEq<Close> for Close[src]

impl StructuralPartialEq for Close[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> 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>,