[−][src]Struct bp7::dtntime::CreationTimestamp
Timestamp when a bundle was created, consisting of the DtnTime and a sequence number.
Methods
impl CreationTimestamp
[src]
pub fn new() -> CreationTimestamp
[src]
pub fn with_time_and_seq(t: DtnTime, seqno: u64) -> CreationTimestamp
[src]
pub fn get_seqno(&self) -> u64
[src]
pub fn get_dtntime(&self) -> DtnTime
[src]
pub fn now() -> CreationTimestamp
[src]
Create a new timestamp with automatic sequence counting
Example
use bp7::dtntime::*; use std::{thread, time}; let time1 = CreationTimestamp::now(); let time2 = CreationTimestamp::now(); assert_eq!(time1.get_dtntime(), time2.get_dtntime()); assert_ne!(time1.get_seqno(), time2.get_seqno()); thread::sleep(time::Duration::from_secs(1)); let time3 = CreationTimestamp::now(); assert_eq!(time3.get_seqno(), 0);
Trait Implementations
impl PartialEq<CreationTimestamp> for CreationTimestamp
[src]
fn eq(&self, other: &CreationTimestamp) -> bool
[src]
fn ne(&self, other: &CreationTimestamp) -> bool
[src]
impl Clone for CreationTimestamp
[src]
fn clone(&self) -> CreationTimestamp
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for CreationTimestamp
[src]
fn default() -> CreationTimestamp
[src]
impl Display for CreationTimestamp
[src]
impl Debug for CreationTimestamp
[src]
impl Serialize for CreationTimestamp
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for CreationTimestamp
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl Unpin for CreationTimestamp
impl Sync for CreationTimestamp
impl Send for CreationTimestamp
impl RefUnwindSafe for CreationTimestamp
impl UnwindSafe for CreationTimestamp
Blanket Implementations
impl<T> From<T> for T
[src]
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> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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<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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,