pub enum ZoneRef {
Tz(Tz),
Location(&'static Location),
}Expand description
Reference to a timezone.
Variants§
Implementations§
Source§impl ZoneRef
impl ZoneRef
Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
Returns the name of the zone reference.
For actual timezones that can be the IANA name, for cities and airports this will be the actual name of the location.
Sourcepub fn is_utc(&self) -> bool
pub fn is_utc(&self) -> bool
True if this zone is the UTC zone.
Note that this is different than checking if the zone is currently at UTC+0.
Sourcepub fn kind(&self) -> LocationKind
pub fn kind(&self) -> LocationKind
Returns the kind of location.
Sourcepub fn country(&self) -> Option<&str>
pub fn country(&self) -> Option<&str>
If this zone reference points to a country, returns the country name.
Sourcepub fn admin_code(&self) -> Option<&str>
pub fn admin_code(&self) -> Option<&str>
If the zone has an admin code returns it.
For the US for instance this can be the name of the US state.
Trait Implementations§
impl Copy for ZoneRef
Auto Trait Implementations§
impl Freeze for ZoneRef
impl RefUnwindSafe for ZoneRef
impl Send for ZoneRef
impl Sync for ZoneRef
impl Unpin for ZoneRef
impl UnwindSafe for ZoneRef
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