#[non_exhaustive]pub struct HistoryPage {
pub bars: Vec<Bar>,
pub end_of_history: bool,
pub continue_before: Option<DateTime<Utc>>,
}Expand description
One page of history. A page without bars ends scroll-back like end_of_history does, unless it
names where older bars continue with continue_before, so a feed that
pages by time window can answer an empty window such as a weekend.
Trades streamed through Sink::push_tick extend the page’s newest bar even when they arrive
first. That bar must count only trades the stream did not send, or the feed must hold those
trades until the page is answered. Completed page bars replace bars built from ticks.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.bars: Vec<Bar>Any order, each stamped with its open or any instant inside it: a bar stamped with its
close time lands in the next bar. A bar of a day or longer covers a calendar period of
HistoryRequest::clock, such as a day, a week from Monday or a calendar
month, in UTC by default: stamp it inside that period, for example at its local midnight. A
session open on the evening before can fall in the period of the bar before, and one of
the two bars is then dropped. The chart sorts, deduplicates and validates them.
end_of_history: boolNothing exists before the oldest returned bar (or before request.before when bars is
empty).
continue_before: Option<DateTime<Utc>>On a page without bars: the window had none but older bars exist, and the chart asks
again for the bars before this instant. It must be earlier than request.before, or
the chart stops paging and reports FeedError::InvalidData instead of repeating the
request. Ignored on a page with bars, which continues before its oldest bar.
Implementations§
Source§impl HistoryPage
impl HistoryPage
Sourcepub fn new(bars: Vec<Bar>, end_of_history: bool) -> Self
pub fn new(bars: Vec<Bar>, end_of_history: bool) -> Self
A page of bars, the last one when end_of_history.
Sourcepub fn with_continue_before(self, before: DateTime<Utc>) -> Self
pub fn with_continue_before(self, before: DateTime<Utc>) -> Self
Sets continue_before.
Trait Implementations§
Source§impl Clone for HistoryPage
impl Clone for HistoryPage
Source§fn clone(&self) -> HistoryPage
fn clone(&self) -> HistoryPage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HistoryPage
impl Debug for HistoryPage
Source§impl Default for HistoryPage
impl Default for HistoryPage
Source§fn default() -> HistoryPage
fn default() -> HistoryPage
Source§impl PartialEq for HistoryPage
impl PartialEq for HistoryPage
impl StructuralPartialEq for HistoryPage
Auto Trait Implementations§
impl Freeze for HistoryPage
impl RefUnwindSafe for HistoryPage
impl Send for HistoryPage
impl Sync for HistoryPage
impl Unpin for HistoryPage
impl UnsafeUnpin for HistoryPage
impl UnwindSafe for HistoryPage
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more