Struct id3::Timestamp
[−]
[src]
pub struct Timestamp { pub year: i32, pub month: Option<u8>, pub day: Option<u8>, pub hour: Option<u8>, pub minute: Option<u8>, pub second: Option<u8>, }
Represents a date and time according to the ID3v2.4 spec:
The timestamp fields are based on a subset of ISO 8601. When being as precise as possible the format of a time string is yyyy-MM-ddTHH:mm:ss (year, "-", month, "-", day, "T", hour (out of 24), ":", minutes, ":", seconds), but the precision may be reduced by removing as many time indicators as wanted. Hence valid timestamps are yyyy, yyyy-MM, yyyy-MM-dd, yyyy-MM-ddTHH, yyyy-MM-ddTHH:mm and yyyy-MM-ddTHH:mm:ss. All time stamps are UTC.
Fields
year: i32
month: Option<u8>
day: Option<u8>
hour: Option<u8>
minute: Option<u8>
second: Option<u8>
Methods
impl Timestamp
[src]
fn parse(source: &str) -> Option<Timestamp>
[src]
: Use "yyyy".parse()
Parses a timestamp.
fn to_string(&self) -> String
[src]
Encodes the timestamp for storing in a frame.
Trait Implementations
impl Copy for Timestamp
[src]
impl Clone for Timestamp
[src]
fn clone(&self) -> Timestamp
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Timestamp
[src]
impl PartialEq for Timestamp
[src]
fn eq(&self, __arg_0: &Timestamp) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Timestamp) -> bool
[src]
This method tests for !=
.
impl Eq for Timestamp
[src]
impl PartialOrd for Timestamp
[src]
fn partial_cmp(&self, __arg_0: &Timestamp) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Timestamp) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Timestamp) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Timestamp) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Timestamp) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for Timestamp
[src]
fn cmp(&self, other: &Self) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more