pub enum DateFreq {
Daily,
WeeklyMonday,
WeeklyFriday,
MonthStart,
MonthEnd,
QuarterStart,
QuarterEnd,
YearStart,
YearEnd,
}
Expand description
Represents the frequency at which calendar dates should be generated.
Variants§
Implementations§
Source§impl DateFreq
impl DateFreq
Sourcepub fn to_string(&self) -> String
pub fn to_string(&self) -> String
Returns the canonical string representation of the frequency.
This returns the primary code (e.g., “D”, “W”, “Y”, “YE”), not the aliases.
Sourcepub fn agg_type(&self) -> AggregationType
pub fn agg_type(&self) -> AggregationType
Determines whether the frequency represents a start-of-period or end-of-period aggregation.
Trait Implementations§
Source§impl FromStr for DateFreq
impl FromStr for DateFreq
Source§fn from_str(freq: &str) -> Result<Self, Self::Err>
fn from_str(freq: &str) -> Result<Self, Self::Err>
Attempts to parse a frequency string slice into a DateFreq
enum.
Supports various frequency codes and common aliases.
Code | Alias | Description |
---|---|---|
D | Daily (every day) | |
W | WS | Weekly Monday |
M | MS | Month Start (1st) |
Q | QS | Quarter Start (1st) |
Y | A, AS, YS | Year Start (Jan 1st) |
ME | Month End (Last day) | |
QE | Quarter End (Last day) | |
WF | Weekly Friday | |
YE | AE | Year End (Dec 31st) |
§Arguments
freq
- The frequency string slice (e.g., “D”, “W”, “ME”).
§Errors
Returns an error if the string does not match any known frequency.
impl Copy for DateFreq
impl Eq for DateFreq
impl StructuralPartialEq for DateFreq
Auto Trait Implementations§
impl Freeze for DateFreq
impl RefUnwindSafe for DateFreq
impl Send for DateFreq
impl Sync for DateFreq
impl Unpin for DateFreq
impl UnwindSafe for DateFreq
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