Enum Dst

enum Dst

An enum indicating whether a particular datetime is in DST or not.

DST stands for "daylight saving time." It is a label used to apply to points in time as a way to contrast it with "standard time." DST is usually, but not always, one hour ahead of standard time. When DST takes effect is usually determined by governments, and the rules can vary depending on the location. DST is typically used as a means to maximize "sunlight" time during typical working hours, and as a cost cutting measure by reducing energy consumption. (The effectiveness of DST and whether it is overall worth it is a separate question entirely.)

In general, most users should never need to deal with this type. But it can be occasionally useful in circumstances where callers need to know whether DST is active or not for a particular point in time.

This type has a From<bool> trait implementation, where the bool is interpreted as being true when DST is active.

Variants

No

DST is not in effect. In other words, standard time is in effect.

Yes

DST is in effect.

Implementations

impl Dst

fn is_dst(self: Self) -> bool

Returns true when this value is equal to Dst::Yes.

fn is_std(self: Self) -> bool

Returns true when this value is equal to Dst::No.

std in this context refers to "standard time." That is, it is the offset from UTC used when DST is not in effect.

impl Clone for Dst

fn clone(self: &Self) -> Dst

impl Copy for Dst

impl Debug for Dst

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl Eq for Dst

impl Freeze for Dst

impl From for Dst

fn from(is_dst: bool) -> Dst

impl Hash for Dst

fn hash<__H: $crate::hash::Hasher>(self: &Self, state: &mut __H)

impl Ord for Dst

fn cmp(self: &Self, other: &Dst) -> Ordering

impl PartialEq for Dst

fn eq(self: &Self, other: &Dst) -> bool

impl PartialOrd for Dst

fn partial_cmp(self: &Self, other: &Dst) -> Option<Ordering>

impl RefUnwindSafe for Dst

impl Send for Dst

impl StructuralPartialEq for Dst

impl Sync for Dst

impl Unpin for Dst

impl UnsafeUnpin for Dst

impl UnwindSafe for Dst

impl<T> Any for Dst

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Dst

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Dst

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for Dst

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for Dst

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for Dst

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for Dst

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for Dst

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for Dst

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>