[−][src]Struct pubnub_core::data::timetoken::Timetoken
PubNub Timetoken
This is the timetoken structure that PubNub uses as a stream index. It allows clients to resume streaming from where they left off for added resiliency.
Fields
t: u64Timetoken
r: u32Origin region
Methods
impl Timetoken[src]
pub fn new(time: SystemTime, region: u32) -> Result<Self, SystemTimeError>[src]
Create a Timetoken.
Arguments
time- ASystemTimerepresenting when the message was received by the PubNub global network.region- An internal region identifier for the originating region.
region may be set to 0 if you have nothing better to use. The
combination of a time and region gives us a vector clock that represents
the message origin in spacetime; when and where the message was created.
Using an appropriate region is important for delivery semantics in a
global distributed system.
Errors
Returns an error when the input time argument cannot be transformed
into a duration.
Example
use pubnub_core::data::timetoken::Timetoken; use std::time::SystemTime; let now = SystemTime::now(); let timetoken = Timetoken::new(now, 0)?;
Trait Implementations
impl Clone for Timetoken[src]
impl Copy for Timetoken[src]
impl Debug for Timetoken[src]
impl Default for Timetoken[src]
impl Display for Timetoken[src]
impl Eq for Timetoken[src]
impl Hash for Timetoken[src]
fn hash<__H: Hasher>(&self, state: &mut __H)[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl PartialEq<Timetoken> for Timetoken[src]
impl StructuralEq for Timetoken[src]
impl StructuralPartialEq for Timetoken[src]
Auto Trait Implementations
impl RefUnwindSafe for Timetoken
impl Send for Timetoken
impl Sync for Timetoken
impl Unpin for Timetoken
impl UnwindSafe for Timetoken
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any + ?Sized,
T: Any + ?Sized,
fn type_id_compat(&self) -> TypeId
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> 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> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
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>,