Struct tzfile::RcTz [−][src]
Reference-counted time zone.
This type is equivalent to Rc
<
Tz
>
, but needed to workaround
Rust’s coherence rule to implement TimeZone
.
Implementations
impl RcTz
[src]
pub fn new(tz: Tz) -> Self
[src]
Wraps an existing Tz
object in this reference-counted container.
pub fn named(name: &str) -> Result<Self>
[src]
Reads and parses a system time zone.
Equivalent to calling Tz::named()
and wraps the result in this
reference-counted container.
This function is currently only supported on Unix.
Methods from Deref<Target = Tz>
Trait Implementations
impl Clone for RcTz
[src]
impl Debug for RcTz
[src]
impl Deref for RcTz
[src]
impl Eq for RcTz
[src]
impl From<Tz> for RcTz
[src]
impl Hash for RcTz
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<RcTz> for RcTz
[src]
impl StructuralEq for RcTz
[src]
impl StructuralPartialEq for RcTz
[src]
impl TimeZone for RcTz
[src]
type Offset = Offset<Self>
An associated offset type.
This type is used to store the actual offset in date and time types.
The original TimeZone
value can be recovered via TimeZone::from_offset
. Read more
fn from_offset(offset: &Self::Offset) -> Self
[src]
fn offset_from_utc_datetime(&self, utc: &NaiveDateTime) -> Self::Offset
[src]
fn offset_from_utc_date(&self, utc: &NaiveDate) -> Self::Offset
[src]
fn offset_from_local_date(&self, local: &NaiveDate) -> LocalResult<Self::Offset>
[src]
fn offset_from_local_datetime(
&self,
local: &NaiveDateTime
) -> LocalResult<Self::Offset>
[src]
&self,
local: &NaiveDateTime
) -> LocalResult<Self::Offset>
pub fn ymd(&self, year: i32, month: u32, day: u32) -> Date<Self>
[src]
pub fn ymd_opt(
&self,
year: i32,
month: u32,
day: u32
) -> LocalResult<Date<Self>>
[src]
&self,
year: i32,
month: u32,
day: u32
) -> LocalResult<Date<Self>>
pub fn yo(&self, year: i32, ordinal: u32) -> Date<Self>
[src]
pub fn yo_opt(&self, year: i32, ordinal: u32) -> LocalResult<Date<Self>>
[src]
pub fn isoywd(&self, year: i32, week: u32, weekday: Weekday) -> Date<Self>
[src]
pub fn isoywd_opt(
&self,
year: i32,
week: u32,
weekday: Weekday
) -> LocalResult<Date<Self>>
[src]
&self,
year: i32,
week: u32,
weekday: Weekday
) -> LocalResult<Date<Self>>
pub fn timestamp(&self, secs: i64, nsecs: u32) -> DateTime<Self>
[src]
pub fn timestamp_opt(
&self,
secs: i64,
nsecs: u32
) -> LocalResult<DateTime<Self>>
[src]
&self,
secs: i64,
nsecs: u32
) -> LocalResult<DateTime<Self>>
pub fn timestamp_millis(&self, millis: i64) -> DateTime<Self>
[src]
pub fn timestamp_millis_opt(&self, millis: i64) -> LocalResult<DateTime<Self>>
[src]
pub fn timestamp_nanos(&self, nanos: i64) -> DateTime<Self>
[src]
pub fn datetime_from_str(
&self,
s: &str,
fmt: &str
) -> Result<DateTime<Self>, ParseError>
[src]
&self,
s: &str,
fmt: &str
) -> Result<DateTime<Self>, ParseError>
pub fn from_local_date(&self, local: &NaiveDate) -> LocalResult<Date<Self>>
[src]
pub fn from_local_datetime(
&self,
local: &NaiveDateTime
) -> LocalResult<DateTime<Self>>
[src]
&self,
local: &NaiveDateTime
) -> LocalResult<DateTime<Self>>
pub fn from_utc_date(&self, utc: &NaiveDate) -> Date<Self>
[src]
pub fn from_utc_datetime(&self, utc: &NaiveDateTime) -> DateTime<Self>
[src]
Auto Trait Implementations
impl !RefUnwindSafe for RcTz
impl !Send for RcTz
impl !Sync for RcTz
impl Unpin for RcTz
impl UnwindSafe for RcTz
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,