[−][src]Struct datetime_string::rfc3339::FullTimeStr
String slice for a time in RFC 3339 full-time
format, such as 12:34:56.7890-23:12
.
Implementations
impl FullTimeStr
[src]
pub fn from_str(s: &str) -> Result<&Self, Error>
[src]
Creates a new &FullTimeStr
from a string slice.
Examples
let time = FullTimeStr::from_str("12:34:56.7890-23:12")?; assert_eq!(time.as_str(), "12:34:56.7890-23:12"); assert!(FullTimeStr::from_str("12:34:56Z").is_ok()); assert!(FullTimeStr::from_str("23:59:59+23:59").is_ok()); assert!(FullTimeStr::from_str("00:00:00.0-00:00").is_ok());
pub fn from_mut_str(s: &mut str) -> Result<&mut Self, Error>
[src]
Creates a new &mut FullTimeStr
from a mutable string slice.
Examples
let mut buf = "12:34:56.7890-23:12".to_owned(); let time = FullTimeStr::from_mut_str(&mut buf)?; assert_eq!(time.as_str(), "12:34:56.7890-23:12"); time.partial_time_mut().hms_mut().set_time(0, 22, 44)?; assert_eq!(time.as_str(), "00:22:44.7890-23:12");
pub fn from_bytes(s: &[u8]) -> Result<&Self, Error>
[src]
Creates a new &FullTimeStr
from a byte slice.
Examples
let time = FullTimeStr::from_bytes(b"12:34:56.7890-23:12")?; assert_eq!(time.as_str(), "12:34:56.7890-23:12"); assert!(FullTimeStr::from_bytes(b"12:34:56Z").is_ok()); assert!(FullTimeStr::from_bytes(b"23:59:59+23:59").is_ok()); assert!(FullTimeStr::from_bytes(b"00:00:00.0-00:00").is_ok());
pub fn from_bytes_mut(s: &mut [u8]) -> Result<&mut Self, Error>
[src]
Creates a new &mut FullTimeStr
from a mutable byte slice.
Examples
let mut buf = b"12:34:56.7890-23:12".to_owned(); let time = FullTimeStr::from_bytes_mut(&mut buf[..])?; assert_eq!(time.as_str(), "12:34:56.7890-23:12"); time.partial_time_mut().hms_mut().set_time(0, 22, 44)?; assert_eq!(time.as_str(), "00:22:44.7890-23:12");
#[must_use]pub fn as_str(&self) -> &str
[src]
Returns a string slice.
Examples
let time = FullTimeStr::from_str("12:34:56.7890-23:12")?; assert_eq!(time.as_str(), "12:34:56.7890-23:12");
#[must_use]pub fn as_bytes(&self) -> &[u8]
[src]
Returns a byte slice.
If you want to use indexed access, prefer as_bytes_fixed_len
.
Examples
let time = FullTimeStr::from_str("12:34:56.7890-23:12")?; assert_eq!(time.as_bytes(), b"12:34:56.7890-23:12");
#[must_use]pub fn decompose(&self) -> (&PartialTimeStr, &TimeOffsetStr)
[src]
Decomposes the string into &PartialTimeStr
and &TimeOffsetStr
.
Examples
let time = FullTimeStr::from_str("12:34:56.7890-23:12")?; assert_eq!(time.as_str(), "12:34:56.7890-23:12"); let (partial_time, offset) = time.decompose(); assert_eq!(partial_time.as_str(), "12:34:56.7890"); assert_eq!(offset.as_str(), "-23:12");
#[must_use]pub fn decompose_mut(&mut self) -> (&mut PartialTimeStr, &mut TimeOffsetStr)
[src]
Decomposes the string into &mut PartialTimeStr
and &mut TimeOffsetStr
.
Examples
use datetime_string::common::TimeOffsetSign; let mut buf = "12:34:56.7890-23:12".to_owned(); let time = FullTimeStr::from_mut_str(&mut buf)?; assert_eq!(time.as_str(), "12:34:56.7890-23:12"); let (partial_time, offset) = time.decompose_mut(); assert_eq!(partial_time.as_str(), "12:34:56.7890"); assert_eq!(offset.as_str(), "-23:12"); partial_time.secfrac_mut().unwrap().digits_mut().fill_with_zero(); offset.to_numoffset_mut().unwrap().set_sign(TimeOffsetSign::Positive); assert_eq!(time.as_str(), "12:34:56.0000+23:12");
#[must_use]pub fn partial_time(&self) -> &PartialTimeStr
[src]
Returns a &PartialTimeStr
.
Examples
let time = FullTimeStr::from_str("12:34:56.7890-23:12")?; assert_eq!(time.as_str(), "12:34:56.7890-23:12"); let partial_time = time.partial_time(); assert_eq!(partial_time.as_str(), "12:34:56.7890");
#[must_use]pub fn partial_time_mut(&mut self) -> &mut PartialTimeStr
[src]
Returns a &mut PartialTimeStr
.
Examples
use datetime_string::common::TimeOffsetSign; let mut buf = "12:34:56.7890-23:12".to_owned(); let time = FullTimeStr::from_mut_str(&mut buf)?; assert_eq!(time.as_str(), "12:34:56.7890-23:12"); let partial_time = time.partial_time_mut(); assert_eq!(partial_time.as_str(), "12:34:56.7890"); partial_time.secfrac_mut().unwrap().digits_mut().fill_with_zero(); assert_eq!(time.as_str(), "12:34:56.0000-23:12");
#[must_use]pub fn offset(&self) -> &TimeOffsetStr
[src]
Returns a &TimeOffsetStr
.
Examples
let time = FullTimeStr::from_str("12:34:56.7890-23:12")?; assert_eq!(time.as_str(), "12:34:56.7890-23:12"); let offset = time.offset(); assert_eq!(offset.as_str(), "-23:12");
#[must_use]pub fn offset_mut(&mut self) -> &mut TimeOffsetStr
[src]
Returns a &mut PartialTimeStr
.
Examples
use datetime_string::common::TimeOffsetSign; let mut buf = "12:34:56.7890-23:12".to_owned(); let time = FullTimeStr::from_mut_str(&mut buf)?; assert_eq!(time.as_str(), "12:34:56.7890-23:12"); let offset = time.offset_mut(); assert_eq!(offset.as_str(), "-23:12"); offset.to_numoffset_mut().unwrap().set_sign(TimeOffsetSign::Positive); assert_eq!(time.as_str(), "12:34:56.7890+23:12");
Trait Implementations
impl AsMut<FullTimeStr> for FullTimeString
[src]
fn as_mut(&mut self) -> &mut FullTimeStr
[src]
impl AsMut<FullTimeStr> for FullTimeStr
[src]
fn as_mut(&mut self) -> &mut FullTimeStr
[src]
impl AsRef<[u8]> for FullTimeStr
[src]
impl AsRef<FullTimeStr> for FullTimeString
[src]
fn as_ref(&self) -> &FullTimeStr
[src]
impl AsRef<FullTimeStr> for FullTimeStr
[src]
fn as_ref(&self) -> &FullTimeStr
[src]
impl AsRef<str> for FullTimeStr
[src]
impl Borrow<FullTimeStr> for FullTimeString
[src]
fn borrow(&self) -> &FullTimeStr
[src]
impl BorrowMut<FullTimeStr> for FullTimeString
[src]
fn borrow_mut(&mut self) -> &mut FullTimeStr
[src]
impl Debug for FullTimeStr
[src]
impl Deref for FullTimeStr
[src]
impl<'de> Deserialize<'de> for &'de FullTimeStr
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl Display for FullTimeStr
[src]
impl Eq for FullTimeStr
[src]
impl<'_> From<&'_ FullTimeStr> for FullTimeString
[src]
fn from(v: &FullTimeStr) -> Self
[src]
impl<'a> From<&'a FullTimeStr> for &'a str
[src]
fn from(v: &'a FullTimeStr) -> Self
[src]
impl Hash for FullTimeStr
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for FullTimeStr
[src]
fn cmp(&self, other: &FullTimeStr) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<'_> PartialEq<&'_ [u8]> for FullTimeStr
[src]
impl<'_> PartialEq<&'_ FullTimeStr> for FullTimeString
[src]
impl<'_> PartialEq<&'_ FullTimeStr> for FullTimeStr
[src]
impl<'_> PartialEq<&'_ FullTimeStr> for [u8]
[src]
impl<'_> PartialEq<&'_ FullTimeStr> for str
[src]
impl<'_> PartialEq<&'_ str> for FullTimeStr
[src]
impl PartialEq<[u8]> for FullTimeStr
[src]
impl<'_> PartialEq<[u8]> for &'_ FullTimeStr
[src]
impl PartialEq<FullTimeStr> for FullTimeString
[src]
impl PartialEq<FullTimeStr> for FullTimeStr
[src]
fn eq(&self, other: &FullTimeStr) -> bool
[src]
fn ne(&self, other: &FullTimeStr) -> bool
[src]
impl<'_> PartialEq<FullTimeStr> for &'_ FullTimeStr
[src]
impl PartialEq<FullTimeStr> for [u8]
[src]
impl<'_> PartialEq<FullTimeStr> for &'_ [u8]
[src]
impl PartialEq<FullTimeStr> for str
[src]
impl<'_> PartialEq<FullTimeStr> for &'_ str
[src]
impl PartialEq<FullTimeString> for FullTimeStr
[src]
impl<'_> PartialEq<FullTimeString> for &'_ FullTimeStr
[src]
impl PartialEq<str> for FullTimeStr
[src]
impl<'_> PartialEq<str> for &'_ FullTimeStr
[src]
impl<'_> PartialOrd<&'_ [u8]> for FullTimeStr
[src]
fn partial_cmp(&self, o: &&[u8]) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<&'_ FullTimeStr> for FullTimeString
[src]
fn partial_cmp(&self, o: &&FullTimeStr) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<&'_ FullTimeStr> for FullTimeStr
[src]
fn partial_cmp(&self, o: &&FullTimeStr) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<&'_ FullTimeStr> for [u8]
[src]
fn partial_cmp(&self, o: &&FullTimeStr) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<&'_ FullTimeStr> for str
[src]
fn partial_cmp(&self, o: &&FullTimeStr) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<&'_ str> for FullTimeStr
[src]
fn partial_cmp(&self, o: &&str) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<[u8]> for FullTimeStr
[src]
fn partial_cmp(&self, o: &[u8]) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<[u8]> for &'_ FullTimeStr
[src]
fn partial_cmp(&self, o: &[u8]) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<FullTimeStr> for FullTimeString
[src]
fn partial_cmp(&self, o: &FullTimeStr) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<FullTimeStr> for FullTimeStr
[src]
fn partial_cmp(&self, other: &FullTimeStr) -> Option<Ordering>
[src]
fn lt(&self, other: &FullTimeStr) -> bool
[src]
fn le(&self, other: &FullTimeStr) -> bool
[src]
fn gt(&self, other: &FullTimeStr) -> bool
[src]
fn ge(&self, other: &FullTimeStr) -> bool
[src]
impl<'_> PartialOrd<FullTimeStr> for &'_ FullTimeStr
[src]
fn partial_cmp(&self, o: &FullTimeStr) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<FullTimeStr> for [u8]
[src]
fn partial_cmp(&self, o: &FullTimeStr) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<FullTimeStr> for &'_ [u8]
[src]
fn partial_cmp(&self, o: &FullTimeStr) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<FullTimeStr> for str
[src]
fn partial_cmp(&self, o: &FullTimeStr) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<FullTimeStr> for &'_ str
[src]
fn partial_cmp(&self, o: &FullTimeStr) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<FullTimeString> for FullTimeStr
[src]
fn partial_cmp(&self, o: &FullTimeString) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<FullTimeString> for &'_ FullTimeStr
[src]
fn partial_cmp(&self, o: &FullTimeString) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<str> for FullTimeStr
[src]
fn partial_cmp(&self, o: &str) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<str> for &'_ FullTimeStr
[src]
fn partial_cmp(&self, o: &str) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl Serialize for FullTimeStr
[src]
impl StructuralEq for FullTimeStr
[src]
impl StructuralPartialEq for FullTimeStr
[src]
impl ToOwned for FullTimeStr
[src]
type Owned = FullTimeString
The resulting type after obtaining ownership.
fn to_owned(&self) -> Self::Owned
[src]
fn clone_into(&self, target: &mut Self::Owned)
[src]
impl<'a> TryFrom<&'a [u8]> for &'a FullTimeStr
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(v: &'a [u8]) -> Result<Self, Self::Error>
[src]
impl<'a> TryFrom<&'a mut [u8]> for &'a mut FullTimeStr
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(v: &'a mut [u8]) -> Result<Self, Self::Error>
[src]
impl<'a> TryFrom<&'a mut str> for &'a mut FullTimeStr
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(v: &'a mut str) -> Result<Self, Self::Error>
[src]
impl<'a> TryFrom<&'a str> for &'a FullTimeStr
[src]
Auto Trait Implementations
impl RefUnwindSafe for FullTimeStr
impl Send for FullTimeStr
impl Sync for FullTimeStr
impl Unpin for FullTimeStr
impl UnwindSafe for FullTimeStr
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,