pub struct DateTemplate(/* private fields */);Expand description
Validated date and time display template advertised during registration.
Examples include D/M/Y, Y.M.D, and M-D-YYA; the final A selects a
twelve-hour clock.
Implementations§
Source§impl DateTemplate
impl DateTemplate
Sourcepub fn new(value: impl Into<String>) -> Result<Self, CodecError>
pub fn new(value: impl Into<String>) -> Result<Self, CodecError>
Validates and constructs a station date/time display template.
The template must contain D, M, and either Y or YY exactly once,
separated by /, ., -, or a space. A trailing A requests a
twelve-hour clock.
pub fn as_str(&self) -> &str
pub fn uses_twelve_hour_clock(&self) -> bool
Trait Implementations§
Source§impl AsRef<str> for DateTemplate
impl AsRef<str> for DateTemplate
Source§impl Clone for DateTemplate
impl Clone for DateTemplate
Source§fn clone(&self) -> DateTemplate
fn clone(&self) -> DateTemplate
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DateTemplate
impl Debug for DateTemplate
Source§impl Default for DateTemplate
impl Default for DateTemplate
Source§impl Display for DateTemplate
impl Display for DateTemplate
impl Eq for DateTemplate
Source§impl FromStr for DateTemplate
impl FromStr for DateTemplate
Source§impl Hash for DateTemplate
impl Hash for DateTemplate
Source§impl Ord for DateTemplate
impl Ord for DateTemplate
Source§fn cmp(&self, other: &DateTemplate) -> Ordering
fn cmp(&self, other: &DateTemplate) -> Ordering
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
Source§impl PartialEq for DateTemplate
impl PartialEq for DateTemplate
Source§impl PartialOrd for DateTemplate
impl PartialOrd for DateTemplate
impl StructuralPartialEq for DateTemplate
Auto Trait Implementations§
impl Freeze for DateTemplate
impl RefUnwindSafe for DateTemplate
impl Send for DateTemplate
impl Sync for DateTemplate
impl Unpin for DateTemplate
impl UnsafeUnpin for DateTemplate
impl UnwindSafe for DateTemplate
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