pub struct UtcOffset { /* private fields */ }Expand description
The UTC offset an MTP datetime can carry. Shared with the low-level crate::ptp layer, since
it’s a plain value with no wire or backend detail.
The UTC offset an MTP datetime can carry. Shared with the low-level crate::ptp layer, since
it’s a plain value with no wire or backend detail.
The UTC offset an MTP datetime can carry. Shared with the low-level crate::ptp layer, since
it’s a plain value with no wire or backend detail.
An offset from UTC, as an MTP datetime’s Z or ±hhmm suffix writes it.
Holds whole minutes east of UTC, within ±23:59 (the most ±hhmm can express).
§Example
use mtp_rs::ptp::UtcOffset;
let ist = UtcOffset::from_minutes(5 * 60 + 30).unwrap();
assert_eq!(ist.minutes(), 330);
assert_eq!(UtcOffset::UTC.minutes(), 0);
assert!(UtcOffset::from_minutes(24 * 60).is_none());Implementations§
Trait Implementations§
impl Copy for UtcOffset
impl Eq for UtcOffset
impl StructuralPartialEq for UtcOffset
Auto Trait Implementations§
impl Freeze for UtcOffset
impl RefUnwindSafe for UtcOffset
impl Send for UtcOffset
impl Sync for UtcOffset
impl Unpin for UtcOffset
impl UnsafeUnpin for UtcOffset
impl UnwindSafe for UtcOffset
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