pub struct TimeRange {
pub start: SubstrateTime,
pub end: SubstrateTime,
}Expand description
Time range for queries
Fields§
§start: SubstrateTimeStart time (inclusive)
end: SubstrateTimeEnd time (inclusive)
Implementations§
Source§impl TimeRange
impl TimeRange
Sourcepub fn new(start: SubstrateTime, end: SubstrateTime) -> Self
pub fn new(start: SubstrateTime, end: SubstrateTime) -> Self
Create new time range
Sourcepub fn contains(&self, time: &SubstrateTime) -> bool
pub fn contains(&self, time: &SubstrateTime) -> bool
Check if time is within range
Sourcepub fn past(reference: SubstrateTime) -> Self
pub fn past(reference: SubstrateTime) -> Self
Past cone (everything before reference time)
Sourcepub fn future(reference: SubstrateTime) -> Self
pub fn future(reference: SubstrateTime) -> Self
Future cone (everything after reference time)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TimeRange
impl<'de> Deserialize<'de> for TimeRange
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for TimeRange
Auto Trait Implementations§
impl Freeze for TimeRange
impl RefUnwindSafe for TimeRange
impl Send for TimeRange
impl Sync for TimeRange
impl Unpin for TimeRange
impl UnwindSafe for TimeRange
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
Mutably borrows from an owned value. Read more