[][src]Struct zenoh_protocol::proto::SeqNumGenerator

pub struct SeqNumGenerator(_);

Sequence Number Generator

The SeqNumGenerator encapsulates the generation of sequence numbers.

Implementations

impl SeqNumGenerator[src]

pub fn new(initial_sn: ZInt, sn_resolution: ZInt) -> SeqNumGenerator[src]

Create a new sequence number generator with a given resolution.

Arguments

  • initial_sn - The initial sequence number. It is a good practice to initialize the sequence number generator with a random number

  • sn_resolution - The resolution, in bits, to be used for the sequence number generator. As a consequence of wire zenoh's representation of sequence numbers this should be a multiple of 7.

This funtion will panic if value is out of bound w.r.t. resolution. That is if value is greater or equal than resolution.

pub fn get(&mut self) -> ZInt[src]

Generates the next sequence number

pub fn set(&mut self, sn: ZInt)[src]

Trait Implementations

impl Clone for SeqNumGenerator[src]

impl Copy for SeqNumGenerator[src]

impl Debug for SeqNumGenerator[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>,