#[repr(i32)]pub enum CalendarPeriod {
Unspecified = 0,
Day = 1,
Week = 2,
Fortnight = 3,
Month = 4,
Quarter = 5,
Half = 6,
Year = 7,
}Expand description
A CalendarPeriod represents the abstract concept of a time period that has
a canonical start. Grammatically, “the start of the current
CalendarPeriod.” All calendar times begin at midnight UTC.
Variants§
Unspecified = 0
Undefined period, raises an error.
Day = 1
A day.
Week = 2
A week. Weeks begin on Monday, following ISO 8601.
Fortnight = 3
A fortnight. The first calendar fortnight of the year begins at the start of week 1 according to ISO 8601.
Month = 4
A month.
Quarter = 5
A quarter. Quarters start on dates 1-Jan, 1-Apr, 1-Jul, and 1-Oct of each year.
Half = 6
A half-year. Half-years start on dates 1-Jan and 1-Jul.
Year = 7
A year.
Implementations§
Source§impl CalendarPeriod
impl CalendarPeriod
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Sourcepub fn from_str_name(value: &str) -> Option<CalendarPeriod>
pub fn from_str_name(value: &str) -> Option<CalendarPeriod>
Creates an enum from field names used in the ProtoBuf definition.
Source§impl CalendarPeriod
impl CalendarPeriod
Sourcepub fn is_unspecified(&self) -> bool
pub fn is_unspecified(&self) -> bool
Checks if the value is of the unspecified variant.
Sourcepub fn is_fortnight(&self) -> bool
pub fn is_fortnight(&self) -> bool
Checks if the calendar period is a fortnight.
Sourcepub fn is_quarter(&self) -> bool
pub fn is_quarter(&self) -> bool
Checks if the calendar period is a quarter.
Trait Implementations§
Source§impl Clone for CalendarPeriod
impl Clone for CalendarPeriod
Source§fn clone(&self) -> CalendarPeriod
fn clone(&self) -> CalendarPeriod
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CalendarPeriod
Source§impl Debug for CalendarPeriod
impl Debug for CalendarPeriod
Source§impl Default for CalendarPeriod
impl Default for CalendarPeriod
Source§fn default() -> CalendarPeriod
fn default() -> CalendarPeriod
Source§impl<'de> Deserialize<'de> for CalendarPeriod
impl<'de> Deserialize<'de> for CalendarPeriod
Source§fn deserialize<D>(
deserializer: D,
) -> Result<CalendarPeriod, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<CalendarPeriod, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
impl Eq for CalendarPeriod
Source§impl Hash for CalendarPeriod
impl Hash for CalendarPeriod
Source§impl Ord for CalendarPeriod
impl Ord for CalendarPeriod
Source§fn cmp(&self, other: &CalendarPeriod) -> Ordering
fn cmp(&self, other: &CalendarPeriod) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for CalendarPeriod
impl PartialEq for CalendarPeriod
Source§fn eq(&self, other: &CalendarPeriod) -> bool
fn eq(&self, other: &CalendarPeriod) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for CalendarPeriod
impl PartialOrd for CalendarPeriod
Source§impl Serialize for CalendarPeriod
impl Serialize for CalendarPeriod
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
impl StructuralPartialEq for CalendarPeriod
Source§impl TryFrom<i32> for CalendarPeriod
impl TryFrom<i32> for CalendarPeriod
Source§type Error = UnknownEnumValue
type Error = UnknownEnumValue
Source§fn try_from(value: i32) -> Result<CalendarPeriod, UnknownEnumValue>
fn try_from(value: i32) -> Result<CalendarPeriod, UnknownEnumValue>
Auto Trait Implementations§
impl Freeze for CalendarPeriod
impl RefUnwindSafe for CalendarPeriod
impl Send for CalendarPeriod
impl Sync for CalendarPeriod
impl Unpin for CalendarPeriod
impl UnsafeUnpin for CalendarPeriod
impl UnwindSafe for CalendarPeriod
Blanket Implementations§
Source§impl<T> AnyExt for T
impl<T> AnyExt for T
Source§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind referenceSource§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable referenceSource§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointerSource§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointer