pub struct WrappedRead {
pub command: Reads,
/* private fields */
}
Expand description
A wrapped version of a Reads
exposing a builder API used to send/receive data over the wire.
Fields§
§command: Reads
EtherCAT command.
Implementations§
Source§impl WrappedRead
impl WrappedRead
Sourcepub fn ignore_wkc(self) -> Self
pub fn ignore_wkc(self) -> Self
Do not return an error if the working counter is different from the expected value.
The default value is 1
and can be overridden with with_wkc
.
Sourcepub fn with_wkc(self, wkc: u16) -> Self
pub fn with_wkc(self, wkc: u16) -> Self
Change the expected working counter from its default of 1
.
Sourcepub async fn receive<'maindevice, T>(
self,
maindevice: &'maindevice MainDevice<'maindevice>,
) -> Result<T, Error>where
T: EtherCrabWireRead + EtherCrabWireSized,
pub async fn receive<'maindevice, T>(
self,
maindevice: &'maindevice MainDevice<'maindevice>,
) -> Result<T, Error>where
T: EtherCrabWireRead + EtherCrabWireSized,
Receive data and decode into a T
.
Sourcepub async fn receive_slice<'maindevice>(
self,
maindevice: &'maindevice MainDevice<'maindevice>,
len: u16,
) -> Result<ReceivedPdu<'maindevice>, Error>
pub async fn receive_slice<'maindevice>( self, maindevice: &'maindevice MainDevice<'maindevice>, len: u16, ) -> Result<ReceivedPdu<'maindevice>, Error>
Receive a given number of bytes and return it as a slice.
Trait Implementations§
Source§impl Clone for WrappedRead
impl Clone for WrappedRead
Source§fn clone(&self) -> WrappedRead
fn clone(&self) -> WrappedRead
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for WrappedRead
impl Debug for WrappedRead
Source§impl From<WrappedRead> for Command
impl From<WrappedRead> for Command
Source§fn from(value: WrappedRead) -> Self
fn from(value: WrappedRead) -> Self
Converts to this type from the input type.
impl Copy for WrappedRead
Auto Trait Implementations§
impl Freeze for WrappedRead
impl RefUnwindSafe for WrappedRead
impl Send for WrappedRead
impl Sync for WrappedRead
impl Unpin for WrappedRead
impl UnwindSafe for WrappedRead
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more