pub struct PiecewiseLinearFunctionBuilder {
    largest_x: Option<CSSFloat>,
    smallest_x: Option<CSSFloat>,
    entries: Vec<BuildEntry>,
}Expand description
Builder object to generate a linear function.
Fields§
§largest_x: Option<CSSFloat>§smallest_x: Option<CSSFloat>§entries: Vec<BuildEntry>Implementations§
Source§impl PiecewiseLinearFunctionBuilder
 
impl PiecewiseLinearFunctionBuilder
Sourcepub fn with_capacity(len: usize) -> Self
 
pub fn with_capacity(len: usize) -> Self
Create a builder for a known amount of linear stop entries.
fn create_entry(&mut self, y: CSSFloat, x: Option<CSSFloat>)
Sourcepub fn push(&mut self, y: CSSFloat, x_start: Option<CSSFloat>)
 
pub fn push(&mut self, y: CSSFloat, x_start: Option<CSSFloat>)
Add a new entry into the piecewise linear function with specified y value. If the start x value is given, that is where the x value will be. Otherwise, the x value is calculated later. If the end x value is specified, a flat segment is generated. If start x value is not specified but end x is, it is treated as start x.
Sourcepub fn build(self) -> PiecewiseLinearFunction
 
pub fn build(self) -> PiecewiseLinearFunction
Finish building the piecewise linear function by resolving all undefined x values, then return the result.
Trait Implementations§
Source§impl Default for PiecewiseLinearFunctionBuilder
 
impl Default for PiecewiseLinearFunctionBuilder
Source§fn default() -> PiecewiseLinearFunctionBuilder
 
fn default() -> PiecewiseLinearFunctionBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PiecewiseLinearFunctionBuilder
impl RefUnwindSafe for PiecewiseLinearFunctionBuilder
impl Send for PiecewiseLinearFunctionBuilder
impl Sync for PiecewiseLinearFunctionBuilder
impl Unpin for PiecewiseLinearFunctionBuilder
impl UnwindSafe for PiecewiseLinearFunctionBuilder
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> 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 moreSource§impl<T> MaybeBoxed<Box<T>> for T
 
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
 
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
 
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
 
fn maybe_boxed(self) -> T
Convert