#[non_exhaustive]pub struct CandleQuery {
pub interval: CandleInterval,
pub start: UnixMillis,
pub end: Option<UnixMillis>,
}Expand description
Which candles to read: their width and the open times they span.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.interval: CandleIntervalThe candles’ width.
start: UnixMillisThe earliest open time.
end: Option<UnixMillis>The latest open time; now, when None.
Implementations§
Source§impl CandleQuery
impl CandleQuery
Sourcepub fn new(interval: CandleInterval, start: UnixMillis) -> Self
pub fn new(interval: CandleInterval, start: UnixMillis) -> Self
Candles of interval from start to now.
Sourcepub fn end(self, end: UnixMillis) -> Self
pub fn end(self, end: UnixMillis) -> Self
Ends the span at end.
Sourcepub fn ensure_served(
&self,
served: &'static [CandleInterval],
) -> Result<(), UnservedInterval>
pub fn ensure_served( &self, served: &'static [CandleInterval], ) -> Result<(), UnservedInterval>
Checks that the query’s width is one of served, which a venue takes
from its Candles::intervals. Call it
before the first request, and convert the refusal with ?.
Trait Implementations§
Source§impl Clone for CandleQuery
impl Clone for CandleQuery
impl Copy for CandleQuery
Source§impl Debug for CandleQuery
impl Debug for CandleQuery
impl Eq for CandleQuery
Source§impl PartialEq for CandleQuery
impl PartialEq for CandleQuery
impl StructuralPartialEq for CandleQuery
Auto Trait Implementations§
impl Freeze for CandleQuery
impl RefUnwindSafe for CandleQuery
impl Send for CandleQuery
impl Sync for CandleQuery
impl Unpin for CandleQuery
impl UnsafeUnpin for CandleQuery
impl UnwindSafe for CandleQuery
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