Struct zenoh_protocol::network::declare::interest::DeclareInterest

source ·
pub struct DeclareInterest {
    pub id: InterestId,
    pub wire_expr: WireExpr<'static>,
    pub interest: Interest,
}
Expand description

§DeclareInterest message

The DECLARE INTEREST message is sent to request the transmission of existing and future declarations of a given kind matching a target keyexpr. E.g., a declare interest could be sent to request the transmisison of all existing subscriptions matching a/*. A FINAL INTEREST is used to mark the end of the transmission of exisiting matching declarations.

E.g., the DeclareInterest/FinalInterest/UndeclareInterest message flow is the following:

    A                   B
    |   DECL INTEREST   |
    |------------------>| -- This is a DeclareInterest e.g. for subscriber declarations/undeclarations.
    |                   |
    |  DECL SUBSCRIBER  |
    |<------------------|
    |  DECL SUBSCRIBER  |
    |<------------------|
    |  DECL SUBSCRIBER  |
    |<------------------|
    |                   |
    |   FINAL INTEREST  |
    |<------------------|  -- The FinalInterest signals that all known subscribers have been transmitted.
    |                   |
    |  DECL SUBSCRIBER  |
    |<------------------|  -- This is a new subscriber declaration.
    | UNDECL SUBSCRIBER |
    |<------------------|  -- This is a new subscriber undeclaration.
    |                   |
    |        ...        |
    |                   |
    |  UNDECL INTEREST  |
    |------------------>|  -- This is an UndeclareInterest to stop receiving subscriber declarations/undeclarations.
    |                   |

The DECLARE INTEREST message structure is defined as follows:

Flags:
- N: Named          If N==1 then the key expr has name/suffix
- M: Mapping        if M==1 then key expr mapping is the one declared by the sender, else it is the one declared by the receiver
- Z: Extension      If Z==1 then at least one extension is present

7 6 5 4 3 2 1 0
+-+-+-+-+-+-+-+-+
|Z|M|N|  D_INT  |
+---------------+
~ intst_id:z32  ~
+---------------+
~ key_scope:z16 ~
+---------------+
~  key_suffix   ~  if N==1 -- <u8;z16>
+---------------+
|A|F|C|X|T|Q|S|K|  (*)
+---------------+
~  [decl_exts]  ~  if Z==1
+---------------+

(*) - if K==1 then the interest refers to key expressions
    - if S==1 then the interest refers to subscribers
    - if Q==1 then the interest refers to queryables
    - if T==1 then the interest refers to tokens
    - if C==1 then the interest refers to the current declarations.
    - if F==1 then the interest refers to the future declarations. Note that if F==0 then:
              - replies SHOULD NOT be sent after the FinalInterest;
              - UndeclareInterest SHOULD NOT be sent after the FinalInterest.
    - if A==1 then the replies SHOULD be aggregated

Fields§

§id: InterestId§wire_expr: WireExpr<'static>§interest: Interest

Trait Implementations§

source§

impl Clone for DeclareInterest

source§

fn clone(&self) -> DeclareInterest

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for DeclareInterest

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for DeclareInterest

source§

fn eq(&self, other: &DeclareInterest) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for DeclareInterest

source§

impl StructuralPartialEq for DeclareInterest

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> AsNode<T> for T

source§

fn as_node(&self) -> &T

source§

impl<T> AsNodeMut<T> for T

source§

fn as_node_mut(&mut self) -> &mut T

source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

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

source§

fn vzip(self) -> V