pub enum Interval {
Show 13 variants
M1,
M3,
M5,
M15,
M30,
H1,
H2,
H4,
H6,
H12,
D1,
W1,
M,
}Expand description
Valid kline intervals supported by Bybit API.
This enum provides type-safe interval specification for kline requests. Each variant corresponds to a valid interval string accepted by the Bybit API.
Variants§
M1
1 minute
M3
3 minutes
M5
5 minutes
M15
15 minutes
M30
30 minutes
H1
1 hour
H2
2 hours
H4
4 hours
H6
6 hours
H12
12 hours
D1
1 day
W1
1 week
M
1 month
Implementations§
Source§impl Interval
impl Interval
Sourcepub fn as_str(&self) -> &'static str
pub fn as_str(&self) -> &'static str
Returns the string representation of the interval as expected by the Bybit API.
Sourcepub fn from_str(s: &str) -> Option<Self>
pub fn from_str(s: &str) -> Option<Self>
Parses a string into an Interval enum.
Returns Some(Interval) if the string is a valid interval, None otherwise.
Sourcepub fn duration_seconds(&self) -> u64
pub fn duration_seconds(&self) -> u64
Returns the duration of the interval in seconds.
Sourcepub fn duration_millis(&self) -> u64
pub fn duration_millis(&self) -> u64
Returns the duration of the interval in milliseconds.
Trait Implementations§
impl Copy for Interval
impl Eq for Interval
impl StructuralPartialEq for Interval
Auto Trait Implementations§
impl Freeze for Interval
impl RefUnwindSafe for Interval
impl Send for Interval
impl Sync for Interval
impl Unpin for Interval
impl UnsafeUnpin for Interval
impl UnwindSafe for Interval
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.