pub struct CandleWindow { /* private fields */ }Implementations§
Source§impl CandleWindow
impl CandleWindow
pub fn new(capacity: usize) -> Self
pub fn push(&mut self, open: f64, high: f64, low: f64, close: f64)
Sourcepub fn bar(&self, idx: usize) -> Candle
pub fn bar(&self, idx: usize) -> Candle
Access bars backwards: 0 is current, 1 is previous, etc.
Total by construction: callers gate on len() before indexing, and an
out-of-range index yields a zeroed candle rather than panicking (the
workspace forbids panics in core).
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for CandleWindow
impl Clone for CandleWindow
Auto Trait Implementations§
impl Forget for CandleWindow
impl Freeze for CandleWindow
impl Move for CandleWindow
impl RefUnwindSafe for CandleWindow
impl Send for CandleWindow
impl Sync for CandleWindow
impl Unpin for CandleWindow
impl UnsafeUnpin for CandleWindow
impl UnwindSafe for CandleWindow
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.