[][src]Struct bp7::dtntime::CreationTimestamp

pub struct 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 Default for CreationTimestamp[src]

impl Clone for CreationTimestamp[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl PartialEq<CreationTimestamp> for CreationTimestamp[src]

impl Debug for CreationTimestamp[src]

impl Display for CreationTimestamp[src]

impl Serialize for CreationTimestamp[src]

impl<'de> Deserialize<'de> for CreationTimestamp[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]