pub struct TemporalOrderingConstraint { /* private fields */ }Expand description
Temporal ordering constraint for validating time-based relationships.
This constraint ensures that temporal data follows expected patterns, including:
- Chronological ordering between columns
- Business hour compliance
- Date range validation
- Event sequence validation
- Time gap analysis
The constraint supports various temporal data types and timezone considerations.
Implementations§
Source§impl TemporalOrderingConstraint
impl TemporalOrderingConstraint
Sourcepub fn before_after(
self,
before_column: impl Into<String>,
after_column: impl Into<String>,
) -> Self
pub fn before_after( self, before_column: impl Into<String>, after_column: impl Into<String>, ) -> Self
Validate that one timestamp column comes before another.
§Arguments
before_column- Column that should contain earlier timestampsafter_column- Column that should contain later timestamps
Sourcepub fn before_or_equal(
self,
before_column: impl Into<String>,
after_column: impl Into<String>,
) -> Self
pub fn before_or_equal( self, before_column: impl Into<String>, after_column: impl Into<String>, ) -> Self
Validate that one timestamp column comes before or equals another.
Sourcepub fn business_hours(
self,
timestamp_column: impl Into<String>,
start_time: impl Into<String>,
end_time: impl Into<String>,
) -> Self
pub fn business_hours( self, timestamp_column: impl Into<String>, start_time: impl Into<String>, end_time: impl Into<String>, ) -> Self
Validate that timestamps fall within business hours.
§Arguments
timestamp_column- Column containing timestamps to validatestart_time- Start of business hours (format: “HH:MM”)end_time- End of business hours (format: “HH:MM”)
Sourcepub fn weekdays_only(self, weekdays_only: bool) -> Self
pub fn weekdays_only(self, weekdays_only: bool) -> Self
Set whether business hours validation should only apply to weekdays.
Sourcepub fn with_timezone(self, timezone: impl Into<String>) -> Self
pub fn with_timezone(self, timezone: impl Into<String>) -> Self
Set the timezone for business hours validation.
Sourcepub fn date_range(
self,
timestamp_column: impl Into<String>,
min_date: Option<impl Into<String>>,
max_date: Option<impl Into<String>>,
) -> Self
pub fn date_range( self, timestamp_column: impl Into<String>, min_date: Option<impl Into<String>>, max_date: Option<impl Into<String>>, ) -> Self
Validate that timestamps are within a specific date range.
Sourcepub fn max_time_gap(
self,
timestamp_column: impl Into<String>,
max_gap_seconds: i64,
) -> Self
pub fn max_time_gap( self, timestamp_column: impl Into<String>, max_gap_seconds: i64, ) -> Self
Validate maximum time gap between sequential events.
Sourcepub fn group_by(self, column: impl Into<String>) -> Self
pub fn group_by(self, column: impl Into<String>) -> Self
Set grouping column for time gap validation.
Sourcepub fn allow_nulls(self, allow: bool) -> Self
pub fn allow_nulls(self, allow: bool) -> Self
Set whether to allow null timestamps.
Sourcepub fn tolerance_seconds(self, seconds: i64) -> Self
pub fn tolerance_seconds(self, seconds: i64) -> Self
Set tolerance for temporal comparisons in seconds.
Trait Implementations§
Source§impl Clone for TemporalOrderingConstraint
impl Clone for TemporalOrderingConstraint
Source§fn clone(&self) -> TemporalOrderingConstraint
fn clone(&self) -> TemporalOrderingConstraint
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Constraint for TemporalOrderingConstraint
impl Constraint for TemporalOrderingConstraint
Source§fn evaluate<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 SessionContext,
) -> Pin<Box<dyn Future<Output = Result<ConstraintResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn evaluate<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 SessionContext,
) -> Pin<Box<dyn Future<Output = Result<ConstraintResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn column(&self) -> Option<&str>
fn column(&self) -> Option<&str>
Source§fn description(&self) -> Option<&str>
fn description(&self) -> Option<&str>
Source§fn metadata(&self) -> ConstraintMetadata
fn metadata(&self) -> ConstraintMetadata
Source§impl Debug for TemporalOrderingConstraint
impl Debug for TemporalOrderingConstraint
Source§impl<'de> Deserialize<'de> for TemporalOrderingConstraint
impl<'de> Deserialize<'de> for TemporalOrderingConstraint
Source§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>,
Auto Trait Implementations§
impl Freeze for TemporalOrderingConstraint
impl RefUnwindSafe for TemporalOrderingConstraint
impl Send for TemporalOrderingConstraint
impl Sync for TemporalOrderingConstraint
impl Unpin for TemporalOrderingConstraint
impl UnwindSafe for TemporalOrderingConstraint
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more