pub struct Every { /* private fields */ }Expand description
Implementations§
Source§impl Every
impl Every
Sourcepub fn to_including(self, end: Dt) -> TimeRange ⓘ
pub fn to_including(self, end: Dt) -> TimeRange ⓘ
Creates an inclusive time range (start ... end).
The resulting iterator will yield end as the final element
(provided end is reachable from start with the given step).
Sourcepub fn to_excluding(self, end: Dt) -> TimeRange ⓘ
pub fn to_excluding(self, end: Dt) -> TimeRange ⓘ
Creates an exclusive time range (start ... end).
The resulting iterator will not yield end.
Source§impl Every
impl Every
Sourcepub fn to_wire_bytes(&self) -> [u8; 34]
pub fn to_wire_bytes(&self) -> [u8; 34]
Serializes this Every builder into a fixed 33-byte buffer.
The layout is simply the concatenation of start (17 bytes) and step (16 bytes).
Sourcepub fn from_wire_bytes(bytes: &[u8]) -> Option<Self>
pub fn from_wire_bytes(bytes: &[u8]) -> Option<Self>
Deserializes an Every builder from exactly 33 bytes.
§Security
Safe for untrusted input. Fixed size with strict validation
of the inner Dt and Dt.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Every
impl<'de> Deserialize<'de> for Every
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
Source§impl Tsify for Every
impl Tsify for Every
const DECL: &'static str = "/**\n * Builder type that enables the ergonomic `start.every(step)` syntax.\n *\n * This struct is created by [`Dt::every`] and is used to\n * construct a [`TimeRange`] via either `.until(end)` (inclusive) or\n * `.up_to(end)` (exclusive).\n */\nexport interface Every {\n start: Dt;\n step: Dt;\n}"
const SERIALIZATION_CONFIG: SerializationConfig
type JsType = JsType
fn into_js(&self) -> Result<Self::JsType, Error>where
Self: Serialize,
fn from_js<T>(js: T) -> Result<Self, Error>
Auto Trait Implementations§
impl Freeze for Every
impl RefUnwindSafe for Every
impl Send for Every
impl Sync for Every
impl Unpin for Every
impl UnsafeUnpin for Every
impl UnwindSafe for Every
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