pub struct Series<T> { /* private fields */ }Expand description
A bar-aligned series of values.
Internally this is backed by a VecDeque and is used to represent Pine-like
series variables (one value per bar). You don’t construct Series directly;
it is returned by Instance::chart() inside
visual primitives like Plot.
§Examples
let chart = instance.chart();
for (id, sg) in chart.series_graphs() {
if let Some(plot) = sg.as_plot() {
// Access by index
if let Some(value) = plot.series.get(0) {
println!("First bar value: {:?}", value);
}
// Iterate over all values (by reference)
for (i, val) in (&plot.series).into_iter().enumerate() {
println!("Bar {}: {:?}", i, val);
}
println!("Total bars: {}", plot.series.len());
}
}Implementations§
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for Series<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Series<T>where
T: Deserialize<'de>,
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
Source§impl<'a, T> IntoIterator for &'a Series<T>
impl<'a, T> IntoIterator for &'a Series<T>
Source§impl<T> IntoIterator for Series<T>
impl<T> IntoIterator for Series<T>
Auto Trait Implementations§
impl<T> Freeze for Series<T>
impl<T> RefUnwindSafe for Series<T>where
T: RefUnwindSafe,
impl<T> Send for Series<T>where
T: Send,
impl<T> Sync for Series<T>where
T: Sync,
impl<T> Unpin for Series<T>where
T: Unpin,
impl<T> UnwindSafe for Series<T>where
T: UnwindSafe,
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<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>
Converts
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>
Converts
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§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 more§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).§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.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.