pub struct TimeOfDay { /* private fields */ }Expand description
To the minute, as a time input posts it; stored as HH:MM text, which sorts as it reads.
Implementations§
Source§impl TimeOfDay
impl TimeOfDay
pub fn try_new(hour: i8, minute: i8) -> Result<Self>
pub fn parse(text: &str) -> Result<Self>
Sourcepub const fn constant(text: &str) -> Self
pub const fn constant(text: &str) -> Self
For a time written in code, such as a schedule’s: a wrong one fails the build in a constant.
ⓘ
const _: () = { let _ = sofie_values::TimeOfDay::constant("25:00"); };pub fn hour(self) -> i8
pub fn minute(self) -> i8
pub fn civil(self) -> Time
Trait Implementations§
Source§impl Cast for TimeOfDay
impl Cast for TimeOfDay
const COLUMNS: &'static [ColumnSpec] = String::COLUMNS
fn encode(&self, out: &mut Vec<SqlValue>)
fn decode(row: &mut dyn ColumnReader) -> Result<Self>
const NULLABLE: bool = false
Source§const SENSITIVE: bool = false
const SENSITIVE: bool = false
A field holding it is never filtered, sorted, listed or searched, as
#[sensitive] ones.Source§const MOVES: Option<fn(&Self) -> Option<&'static Targets>> = None
const MOVES: Option<fn(&Self) -> Option<&'static Targets>> = None
Set for a value moving between listed states; a save of any other value skips the check.
Source§const HOLDS_STATES: bool
const HOLDS_STATES: bool
Set when a state anywhere in the value is checked on save, as a field’s of several.
fn refuse_unlisted_move( field: &str, stored: &Self, current: &Self, ) -> Result<(), Error>
impl Copy for TimeOfDay
Source§impl<'de> Deserialize<'de> for TimeOfDay
impl<'de> Deserialize<'de> for TimeOfDay
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TimeOfDay
Source§impl Ord for TimeOfDay
impl Ord for TimeOfDay
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
impl Ordered for TimeOfDay
Source§impl PartialOrd for TimeOfDay
impl PartialOrd for TimeOfDay
impl StructuralPartialEq for TimeOfDay
Auto Trait Implementations§
impl Forget for TimeOfDay
impl Freeze for TimeOfDay
impl RefUnwindSafe for TimeOfDay
impl Send for TimeOfDay
impl Sync for TimeOfDay
impl Unpin for TimeOfDay
impl UnsafeUnpin for TimeOfDay
impl UnwindSafe for TimeOfDay
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