pub struct TimestampBound(/* private fields */);Expand description
Use a timestamp bound to specify how to choose a timestamp at which a query should read data.
§Example
let client = Spanner::builder().build().await.unwrap();
let db = client.database_client("projects/p/instances/i/databases/d").build().await.unwrap();
let tx = db.single_use().set_timestamp_bound(TimestampBound::strong()).build();See https://cloud.google.com/spanner/docs/timestamp-bounds for more information.
Implementations§
Source§impl TimestampBound
impl TimestampBound
Sourcepub fn strong() -> Self
pub fn strong() -> Self
Returns a strong timestamp bound. Strong reads are guaranteed to see the effects of all transactions that have committed before the start of the read.
See timestamp_bound_strong for more information.
Sourcepub fn read_timestamp<T>(timestamp: T) -> Self
pub fn read_timestamp<T>(timestamp: T) -> Self
Returns a timestamp bound for an exact timestamp. The data will be read as it was at the given timestamp.
See timestamp_bound_exact_staleness for more information.
Sourcepub fn try_read_timestamp<T>(timestamp: T) -> Result<Self, T::Error>
pub fn try_read_timestamp<T>(timestamp: T) -> Result<Self, T::Error>
Returns a timestamp bound for an exact timestamp, returning an error if the timestamp is out of range.
See timestamp_bound_exact_staleness for more information.
Sourcepub fn min_read_timestamp<T>(timestamp: T) -> Self
pub fn min_read_timestamp<T>(timestamp: T) -> Self
Returns a timestamp bound for a minimum read timestamp. The data will be read as it was at the given timestamp or later.
See timestamp_bound_bounded_staleness for more information.
Sourcepub fn try_min_read_timestamp<T>(timestamp: T) -> Result<Self, T::Error>
pub fn try_min_read_timestamp<T>(timestamp: T) -> Result<Self, T::Error>
Returns a timestamp bound for a minimum read timestamp, returning an error if the timestamp is out of range.
See timestamp_bound_bounded_staleness for more information.
Sourcepub fn exact_staleness<T>(duration: T) -> Self
pub fn exact_staleness<T>(duration: T) -> Self
Returns a timestamp bound for an exact staleness. The data will be read as it was at the given timestamp calculated by the current server time minus the given duration.
See timestamp_bound_exact_staleness for more information.
Sourcepub fn try_exact_staleness<T>(duration: T) -> Result<Self, T::Error>
pub fn try_exact_staleness<T>(duration: T) -> Result<Self, T::Error>
Returns a timestamp bound for an exact staleness, returning an error if the duration is out of range.
See timestamp_bound_exact_staleness for more information.
Sourcepub fn max_staleness<T>(duration: T) -> Self
pub fn max_staleness<T>(duration: T) -> Self
Returns a timestamp bound for a maximum staleness. The data will be read as it was at the current server time minus the given duration or later.
See timestamp_bound_bounded_staleness for more information.
Sourcepub fn try_max_staleness<T>(duration: T) -> Result<Self, T::Error>
pub fn try_max_staleness<T>(duration: T) -> Result<Self, T::Error>
Returns a timestamp bound for a maximum staleness, returning an error if the duration is out of range.
See timestamp_bound_bounded_staleness for more information.
Trait Implementations§
Source§impl Clone for TimestampBound
impl Clone for TimestampBound
Source§fn clone(&self) -> TimestampBound
fn clone(&self) -> TimestampBound
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for TimestampBound
impl RefUnwindSafe for TimestampBound
impl Send for TimestampBound
impl Sync for TimestampBound
impl Unpin for TimestampBound
impl UnsafeUnpin for TimestampBound
impl UnwindSafe for TimestampBound
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request