Struct dataflow::source::postgres::PG_EPOCH[][src]

struct PG_EPOCH {
    __private_field: (),
}
Expand description

Postgres epoch is 2000-01-01T00:00:00Z

Fields

__private_field: ()

Methods from Deref<Target = SystemTime>

Returns the amount of time elapsed from an earlier point in time.

This function may fail because measurements taken earlier are not guaranteed to always be before later measurements (due to anomalies such as the system clock being adjusted either forwards or backwards). Instant can be used to measure elapsed time without this risk of failure.

If successful, Ok(Duration) is returned where the duration represents the amount of time elapsed from the specified measurement to this one.

Returns an Err if earlier is later than self, and the error contains how far from self the time is.

Examples
use std::time::SystemTime;

let sys_time = SystemTime::now();
let new_sys_time = SystemTime::now();
let difference = new_sys_time.duration_since(sys_time)
    .expect("Clock may have gone backwards");
println!("{:?}", difference);

Returns the difference between the clock time when this system time was created, and the current clock time.

This function may fail as the underlying system clock is susceptible to drift and updates (e.g., the system clock could go backwards), so this function might not always succeed. If successful, Ok(Duration) is returned where the duration represents the amount of time elapsed from this time measurement to the current time.

To measure elapsed time reliably, use Instant instead.

Returns an Err if self is later than the current system time, and the error contains how far from the current system time self is.

Examples
use std::thread::sleep;
use std::time::{Duration, SystemTime};

let sys_time = SystemTime::now();
let one_sec = Duration::from_secs(1);
sleep(one_sec);
assert!(sys_time.elapsed().unwrap() >= one_sec);

Returns Some(t) where t is the time self + duration if t can be represented as SystemTime (which means it’s inside the bounds of the underlying data structure), None otherwise.

Returns Some(t) where t is the time self - duration if t can be represented as SystemTime (which means it’s inside the bounds of the underlying data structure), None otherwise.

Trait Implementations

The resulting type after dereferencing.

Dereferences the value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more