Backlash

Struct Backlash 

Source
pub struct Backlash<T>
where T: Default,
{ /* private fields */ }
Expand description

Backlash processor.

Implementations§

Source§

impl<T> Backlash<T>
where T: Default + Copy + PartialEq + PartialOrd + Add<Output = T> + Sub<Output = T> + Div<Output = T> + From<u8>,

Source

pub fn new(deadband_width: T) -> Self

Returns a new instance.

Source

pub fn update(&mut self, value: T) -> T

Processes a new input and returns the output value.

Source

pub fn set_value(&mut self, value: T)

Sets a new output value without any processing.

Source

pub fn value(&self) -> T

Returns the last output value.

Source

pub fn set_deadband_width(&mut self, deadband_width: T)

Sets a new deadband width and centers the borders around the last output value.

Source

pub fn deadband_width(&self) -> T

Returns the deadband width.

Source

pub fn borders(&self) -> (T, T)

Returns the deadband borders as tuple of (lower, upper).

Source

pub fn center_borders(&mut self, value: T)

Center the deadband borders around a specific value.

Trait Implementations§

Source§

impl<T> Debug for Backlash<T>
where T: Default + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T> Default for Backlash<T>
where T: Default + Default,

Source§

fn default() -> Backlash<T>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<T> Freeze for Backlash<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Backlash<T>
where T: RefUnwindSafe,

§

impl<T> Send for Backlash<T>
where T: Send,

§

impl<T> Sync for Backlash<T>
where T: Sync,

§

impl<T> Unpin for Backlash<T>
where T: Unpin,

§

impl<T> UnwindSafe for Backlash<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.