Struct bp7::dtntime::CreationTimestamp [−][src]
pub struct CreationTimestamp(_, _);
Expand description
Timestamp when a bundle was created, consisting of the DtnTime and a sequence number.
Implementations
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.dtntime(), time2.dtntime()); assert_ne!(time1.seqno(), time2.seqno()); thread::sleep(time::Duration::from_secs(1)); let time3 = CreationTimestamp::now(); assert_eq!(time3.seqno(), 0);
Trait Implementations
Returns the “default value” for a type. Read more
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for CreationTimestamp
impl Send for CreationTimestamp
impl Sync for CreationTimestamp
impl Unpin for CreationTimestamp
impl UnwindSafe for CreationTimestamp
Blanket Implementations
Mutably borrows from an owned value. Read more