pub struct SnapTargets {
pub prices: Vec<f32>,
pub times: Vec<f32>,
pub drawing_points: Vec<Pos2>,
}Expand description
Snap targets - prices and times to snap to
Fields§
§prices: Vec<f32>Y-coordinates of OHLC prices in screen space
times: Vec<f32>X-coordinates of candle times in screen space
drawing_points: Vec<Pos2>Points from existing drawings (for magnet mode)
Implementations§
Source§impl SnapTargets
impl SnapTargets
Sourcepub fn with_price_time(prices: Vec<f32>, times: Vec<f32>) -> Self
pub fn with_price_time(prices: Vec<f32>, times: Vec<f32>) -> Self
Create with price and time targets
Sourcepub fn with_drawing_points(self, points: Vec<Pos2>) -> Self
pub fn with_drawing_points(self, points: Vec<Pos2>) -> Self
Add drawing points for magnet mode
Sourcepub fn set_prices(&mut self, prices: Vec<f32>)
pub fn set_prices(&mut self, prices: Vec<f32>)
Update price targets
Sourcepub fn set_drawing_points(&mut self, points: Vec<Pos2>)
pub fn set_drawing_points(&mut self, points: Vec<Pos2>)
Update drawing points for magnet mode
Trait Implementations§
Source§impl Clone for SnapTargets
impl Clone for SnapTargets
Source§fn clone(&self) -> SnapTargets
fn clone(&self) -> SnapTargets
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SnapTargets
impl Debug for SnapTargets
Source§impl Default for SnapTargets
impl Default for SnapTargets
Source§fn default() -> SnapTargets
fn default() -> SnapTargets
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SnapTargets
impl RefUnwindSafe for SnapTargets
impl Send for SnapTargets
impl Sync for SnapTargets
impl Unpin for SnapTargets
impl UnsafeUnpin for SnapTargets
impl UnwindSafe for SnapTargets
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
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> ⓘ
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