AdiDigitalInput

Struct AdiDigitalInput 

Source
pub struct AdiDigitalInput { /* private fields */ }
Expand description

A struct which represents a V5 ADI port configured as an ADI digital input.

Implementations§

Source§

impl AdiDigitalInput

Source

pub unsafe fn new( port: u8, expander_port: u8, ) -> Result<Self, AdiDigitalInputError>

Initializes an ADI digital input on an ADI port.

§Safety

This function is unsafe because it allows the user to create multiple mutable references to the same ADI digital input. You likely want to implement Robot::new() instead.

Source

pub fn read(&self) -> Result<bool, AdiDigitalInputError>

Gets the digital value (true or false) of the input.

Trait Implementations§

Source§

impl DataSource for AdiDigitalInput

Source§

type Data = bool

The type of data produced by the data source.
Source§

type Error = AdiDigitalInputError

The type of errors which could occur while reading data.
Source§

fn read(&self) -> Result<Self::Data, Self::Error>

Tries to read a new value form the data source.
Source§

impl TryFrom<AdiPort> for AdiDigitalInput

Source§

fn try_from(port: AdiPort) -> Result<Self, Self::Error>

Converts a AdiPort into a AdiDigitalInput.

Source§

type Error = AdiDigitalInputError

The type returned in the event of a conversion error.

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> IntoBroadcast for T
where T: DataSource,

Source§

fn into_broadcast( self, ) -> Result<BroadcastWrapper<T>, (<T as DataSource>::Error, T)>

Converts the data source into a BroadcastWrapper. Read more
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.