Struct Context

Source
pub struct Context<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> Context<'a>

Source

pub fn new( iface_name: &str, port: &'a mut Port, slaves: &'a mut [Slave], slavecount: &'a mut c_int, groups: &'a mut [Group], esibuf: &'a mut ESIBuf, esimap: &'a mut ESIMap, elist: &'a mut ERing, idxstack: &'a mut IdxStack, ecaterror: &'a mut Boolean, dc_time: &'a mut i64, sm_commtype: &'a mut SMCommType, pdo_assign: &'a mut PDOAssign, pdo_desc: &'a mut PDODesc, eep_sm: &'a mut EEPROMSM, eep_fmmu: &'a mut EEPROMFMMU, ) -> Result<Self, InitError>

Source

pub fn config_init(&mut self, usetable: bool) -> Result<usize, EtherCatError>

Source

pub fn config_map_group<'b>( &'b mut self, io_map: &'a mut [u8; 4096], group: u8, ) -> Result<usize, ErrorIterator<'b>>

Source

pub fn config_dc(&mut self) -> Result<bool, ErrorIterator<'_>>

Source

pub fn check_state( &mut self, slave: u16, state: EtherCatState, timeout: c_int, ) -> EtherCatState

Source

pub fn read_state(&mut self) -> EtherCatState

Source

pub fn write_state(&mut self, slave: u16) -> Result<u16, EtherCatError>

Source

pub fn set_state(&mut self, state: EtherCatState, slave: u16)

Source

pub fn dc_time(&mut self) -> i64

Source

pub fn slaves(&mut self) -> &mut [Slave]

Source

pub fn groups(&mut self) -> &'a [Group]

Source

pub fn send_processdata(&mut self)

Source

pub fn receive_processdata(&mut self, timeout: c_int) -> u16

Source

pub fn write_sdo<'b, T: PrimInt + ?Sized>( &'b mut self, slave: u16, index: u16, subindex: u8, value: &T, timeout: c_int, ) -> Result<(), ErrorIterator<'b>>

Source

pub fn read_sdo<T: PrimInt + ?Sized>( &mut self, slave: u16, index: u16, subindex: u8, timeout: c_int, ) -> Result<T, ErrorIterator<'_>>

Trait Implementations§

Source§

impl<'a> Debug for Context<'a>

Source§

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

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

impl<'a> Drop for Context<'a>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Context<'a>

§

impl<'a> RefUnwindSafe for Context<'a>

§

impl<'a> !Send for Context<'a>

§

impl<'a> !Sync for Context<'a>

§

impl<'a> Unpin for Context<'a>

§

impl<'a> UnwindSafe for Context<'a>

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.