Struct veeks_millis::MilliTime [−][src]
milli_time format is fixed and global: from 000md
to 999md
, always 3 digits, no space, suffix md
Implementations
impl MilliTime
[src]
pub fn from_hms(hour: u32, minute: u32, second: u32) -> Option<Self>
[src]
constructor from hour, minute, second, rounded to 1md returns None on error
Example
let millis = veeks_millis::MilliTime::from_hms(13,53,58).unwrap(); assert_eq!(millis.to_string(),"579md");
pub fn from_naive_time(nt: NaiveTime) -> Self
[src]
constructor from chrono NaiveTime, rounded to 1md
Example
let nt = chrono::NaiveTime::from_hms(13,30,00); let millis = veeks_millis::MilliTime::from_naive_time(nt); assert_eq!(millis.milliday(),563);
pub fn from_str(s: &str) -> Option<Self>
[src]
constructor from string millis 000md
to 999md
returns None if unrecognized format
Example
let millis = veeks_millis::MilliTime::from_str("560md").unwrap(); assert_eq!(millis.milliday(),560);
pub fn milliday(&self) -> u32
[src]
getter milliday f64
Example
let veeks = veeks_millis::MilliTime::from_hms(13,53,58).unwrap(); assert_eq!(veeks.milliday(),579);
pub fn to_naive_time(&self) -> Option<NaiveTime>
[src]
convert millis to chrono NaiveTime rounded to 1 second returns None if error
Example
let millis = veeks_millis::MilliTime::from_str("560md").unwrap(); let nt = millis.to_naive_time().unwrap(); assert_eq!(nt,chrono::NaiveTime::from_hms(13,26,24));
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for MilliTime
[src]
impl Send for MilliTime
[src]
impl Sync for MilliTime
[src]
impl Unpin for MilliTime
[src]
impl UnwindSafe for MilliTime
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,