Struct fefix::fix_values::Tz [−][src]
pub struct Tz { /* fields omitted */ }
Expand description
Timezone indicator.
Examples
use fefix::FixValue;
use fefix::fix_values::Tz;
use std::time::Duration;
let timezone = Tz::deserialize(b"Z").unwrap();
assert_eq!(timezone, Tz::UTC);
assert_eq!(timezone.offset().1, Duration::from_secs(0));
let timezone = Tz::deserialize(b"+03").unwrap();
assert_eq!(timezone.offset(), (1, Duration::from_secs(3 * 3600)));
let timezone = Tz::deserialize(b"-01").unwrap();
assert_eq!(timezone.offset(), (-1, Duration::from_secs(1 * 3600)));
let timezone = Tz::deserialize(b"+04:30").unwrap();
assert_eq!(timezone.offset(), (1, Duration::from_secs(4 * 3600 + 30 * 60)));
Implementations
Calculates the offset information of self
as compared to UTC. The
return value is in the form of a sign (-1, 0, or +1) and a Duration
.
Returns the raw offset from UTC of self
measured in seconds.
This is supported on crate feature utils-chrono
only.
This is supported on crate feature
utils-chrono
only.Converts self
into a chrono::FixedOffset
.
This is supported on crate feature utils-chrono
only.
This is supported on crate feature
utils-chrono
only.Creates a Tz
from a chrono::FixedOffset
.
Trait Implementations
type SerializeSettings = ()
type SerializeSettings = ()
A type with values that customize the serialization algorithm, e.g. padding information. Read more
Writes self
to buffer
using custom serialization settings
.
Like FixValue::deserialize
, but it’s allowed to skip some amount of
input checking. Invalid inputs might not trigger errors and instead be
deserialized as random values. Read more
Writes self
to buffer
using default settings.
Auto Trait Implementations
Blanket Implementations
Mutably borrows from an owned value. Read more