pub struct Duration {
pub milliseconds: i64,
}Expand description
A duration value representing a time span in milliseconds.
Durations are used throughout PromQL for specifying time ranges, offsets, and subquery steps.
§Example
use rusty_promql_parser::lexer::duration::Duration;
let dur = Duration::from_secs(300);
assert_eq!(dur.as_millis(), 300_000);
assert_eq!(dur.to_string(), "5m");Fields§
§milliseconds: i64Duration in milliseconds (can be negative for negative offsets)
Implementations§
Trait Implementations§
impl Copy for Duration
impl Eq for Duration
impl StructuralPartialEq for Duration
Auto Trait Implementations§
impl Freeze for Duration
impl RefUnwindSafe for Duration
impl Send for Duration
impl Sync for Duration
impl Unpin for Duration
impl UnwindSafe for Duration
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