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

The UTC timezone.

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.

Converts self into a chrono::FixedOffset.

This is supported on crate feature utils-chrono only.

Creates a Tz from a chrono::FixedOffset.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The error type that can arise during deserialization.

A type with values that customize the serialization algorithm, e.g. padding information. Read more

Writes self to buffer using custom serialization settings.

Parses and deserializes from data.

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.

Serializes self to a Vec of bytes, allocated on the fly.

Allocates a String representation of self. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.