pub enum Timeframe {
Second(u32),
Minute(u32),
Hour(u32),
Day(u32),
Week(u32),
Month(u32),
}Expand description
Provider-neutral chart timeframe.
Variants§
Implementations§
Source§impl Timeframe
impl Timeframe
pub fn validate(self) -> Result<Self, TimeframeError>
Sourcepub fn bucket_close(self, bucket_open_ts: i64) -> Option<i64>
pub fn bucket_close(self, bucket_open_ts: i64) -> Option<i64>
The bucket’s close timestamp (exclusive upper bound), given the bucket’s open timestamp
(as returned in Bar::timestamp for a completed bar from BarResampler/
ConfirmedResampler). Calendar months have no fixed width — use bucket_start on the
next bar to find the following bucket’s boundary instead.
Sourcepub fn fixed_seconds(self) -> Option<u64>
pub fn fixed_seconds(self) -> Option<u64>
Returns a fixed duration. Calendar months intentionally return None.
Trait Implementations§
impl Copy for Timeframe
Source§impl<'de> Deserialize<'de> for Timeframe
impl<'de> Deserialize<'de> for Timeframe
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Timeframe
impl StructuralPartialEq for Timeframe
Auto Trait Implementations§
impl Freeze for Timeframe
impl RefUnwindSafe for Timeframe
impl Send for Timeframe
impl Sync for Timeframe
impl Unpin for Timeframe
impl UnsafeUnpin for Timeframe
impl UnwindSafe for Timeframe
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