Struct TankLevelSwitchSignals

Source
pub struct TankLevelSwitchSignals {
    pub tank_level_switch_position: bool,
    pub tank_level_switch_position_stabilized: bool,
    pub tank_level_switch_invalid: bool,
}
Expand description

Contains all signal information from the tank level switch relevant for other threads:

  • measured tank level switch position
  • stabilized tank level switch position
  • flag indicating if the tank level switch position is invalid

Fields§

§tank_level_switch_position: bool

measured pin state

§tank_level_switch_position_stabilized: bool

calculated stabilized pin state

§tank_level_switch_invalid: bool

flag indicating if the tank level switch position is invalid

Implementations§

Source§

impl TankLevelSwitchSignals

Source

pub fn new( tank_level_switch_position: bool, tank_level_switch_position_stabilized: bool, tank_level_switch_invalid: bool, ) -> TankLevelSwitchSignals

Creates a new TankLevelSwitchSignals struct with initial status values.

This constructor sets the initially measured position, the calculated stabilized position, and the validity flag of the tank level switch. It’s a general-purpose constructor for this data-holding struct.

§Arguments
  • tank_level_switch_position - The initial measured pin state (true for high water, false for low).
  • tank_level_switch_position_stabilized - The initial calculated stabilized pin state.
  • tank_level_switch_invalid - The initial flag indicating if the switch position is considered invalid.
§Returns

A new TankLevelSwitchSignals struct.

Auto Trait Implementations§

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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T