[−][src]Struct zenoh_protocol::proto::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]
fn clone(&self) -> SeqNumGenerator
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for SeqNumGenerator
[src]
impl Debug for SeqNumGenerator
[src]
Auto Trait Implementations
impl RefUnwindSafe for SeqNumGenerator
impl Send for SeqNumGenerator
impl Sync for SeqNumGenerator
impl Unpin for SeqNumGenerator
impl UnwindSafe for SeqNumGenerator
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,
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> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,