pub struct SeriesHandle { /* private fields */ }Expand description
App-owned, versioned series data. Create once, clone into the spec each
frame (a cheap Arc bump), mutate with set /
append. The stable id keys the GPU buffer
cache for the geometry this series lowers to; revision
advances on every mutation so the backend re-uploads only when the data
actually changed.
Implementations§
Source§impl SeriesHandle
impl SeriesHandle
Sourcepub fn new(samples: impl Into<Vec<Sample>>) -> Self
pub fn new(samples: impl Into<Vec<Sample>>) -> Self
A handle owning samples, with a fresh stable id.
Sourcepub fn set(&self, samples: impl Into<Vec<Sample>>)
pub fn set(&self, samples: impl Into<Vec<Sample>>)
Replace the samples and advance the revision. The hot path for a
virtual app: as the user pans/zooms, resample the source to the
visible window and set the result.
Sourcepub fn append(&self, more: &[Sample])
pub fn append(&self, more: &[Sample])
Append samples to the tail and advance the revision — for a live series that grows over time. Recomputes bounds over the new tail only.
Sourcepub fn id(&self) -> GeometryId
pub fn id(&self) -> GeometryId
The stable id, constant for the handle’s life. Backends key the GPU buffers for this series’ lowered geometry on it.
Sourcepub fn bounds(&self) -> SeriesBounds
pub fn bounds(&self) -> SeriesBounds
The cached data-space SeriesBounds.
Trait Implementations§
Source§impl Clone for SeriesHandle
impl Clone for SeriesHandle
Source§fn clone(&self) -> SeriesHandle
fn clone(&self) -> SeriesHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SeriesHandle
impl RefUnwindSafe for SeriesHandle
impl Send for SeriesHandle
impl Sync for SeriesHandle
impl Unpin for SeriesHandle
impl UnsafeUnpin for SeriesHandle
impl UnwindSafe for SeriesHandle
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,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.