EnvelopePoint

Trait EnvelopePoint 

Source
pub trait EnvelopePoint: Clone + PartialEq {
    type X: Float + ToString;
    type Y: Float + ToString;

    // Required methods
    fn get_x(&self) -> Self::X;
    fn get_y(&self) -> Self::Y;
    fn set_x(&mut self, _x: Self::X);
    fn set_y(&mut self, _y: Self::Y);
    fn new(_x: Self::X, _y: Self::Y) -> Self;

    // Provided methods
    fn get_curve(&self) -> f32 { ... }
    fn set_curve(&mut self, _curve: f32) { ... }
}
Expand description

EnvPoint must be implemented for any type that is used as a 2D point within the EnvelopeEditor.

Required Associated Types§

Source

type X: Float + ToString

A value on the X-axis of the envelope.

Source

type Y: Float + ToString

A value on the Y-axis of the envelope.

Required Methods§

Source

fn get_x(&self) -> Self::X

Return the X value.

Source

fn get_y(&self) -> Self::Y

Return the Y value.

Source

fn set_x(&mut self, _x: Self::X)

Set the X value.

Source

fn set_y(&mut self, _y: Self::Y)

Set the Y value.

Source

fn new(_x: Self::X, _y: Self::Y) -> Self

Create a new EnvPoint.

Provided Methods§

Source

fn get_curve(&self) -> f32

Return the bezier curve depth (-1. to 1.) for the next interpolation.

Source

fn set_curve(&mut self, _curve: f32)

Set the bezier curve depth (-1. to 1.) for the next interpolation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§