Struct Series
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 visual primitives like Plot.
§Examples
use navi_types::Series;
// Series is typically constructed internally; here we use from_queue for testing.
let mut s: Series<f64> = Series::from_queue(vec![1.0, 2.0, 3.0].into());
assert_eq!(s.len(), 3);
assert_eq!(s.get(0), Some(&1.0));
assert_eq!(s.last(), Some(&3.0));
for val in &s {
let _ = *val;
}Implementations§
§impl<T> Series<T>
impl<T> Series<T>
pub fn from_queue(queue: VecDeque<T>) -> Series<T>
pub fn from_queue(queue: VecDeque<T>) -> Series<T>
Creates a Series from an existing VecDeque.
Trait Implementations§
§impl<'de, T> Deserialize<'de> for Series<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Series<T>where
T: Deserialize<'de>,
§fn deserialize<D>(
deserializer: D,
) -> Result<Series<T>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Series<T>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl<'a, T> IntoIterator for &'a Series<T>
impl<'a, T> IntoIterator for &'a Series<T>
§impl<T> IntoIterator for Series<T>
impl<T> IntoIterator for Series<T>
§impl<T> Serialize for Series<T>where
T: Serialize,
impl<T> Serialize for Series<T>where
T: Serialize,
§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
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> UnsafeUnpin for Series<T>
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<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.