Struct icu::datetime::date::GmtOffset[][src]

pub struct GmtOffset(_);
Expand description

The GMT offset in seconds for a MockTimeZone.

Implementations

Returns the raw offset value in seconds.

Returns true if the GmtOffset is positive, otherwise false.

Returns true if the GmtOffset is zero, otherwise false.

Returns true if the GmtOffset has non-zero minutes, otherwise false.

Returns true if the GmtOffset has non-zero seconds, otherwise false.

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

Returns the “default value” for a type. Read more

Parse a GmtOffset from a string.

The offset must range from GMT-12 to GMT+14. The string must be an ISO 8601 time zone designator: e.g. Z e.g. +05 e.g. +0500 e.g. +05:00

Examples

use icu::datetime::date::GmtOffset;

let offset0: GmtOffset = "Z".parse().expect("Failed to parse a GMT offset.");
let offset1: GmtOffset = "-09".parse().expect("Failed to parse a GMT offset.");
let offset2: GmtOffset = "-0930".parse().expect("Failed to parse a GMT offset.");
let offset3: GmtOffset = "-09:30".parse().expect("Failed to parse a GMT offset.");

The associated error which can be returned from parsing.

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

Clone this trait object reference, returning a boxed trait object.

Return this boxed trait object as Box<dyn Any>. Read more

Return this trait object reference as &dyn Any. 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.