pub struct WrappedWrite {
pub command: Writes,
/* private fields */
}Expand description
A wrapped version of a Writes exposing a builder API used to send/receive data over the
wire.
Fields§
§command: WritesEtherCAT command.
Implementations§
source§impl WrappedWrite
impl WrappedWrite
sourcepub fn with_len(self, new_len: impl Into<u16>) -> Self
pub fn with_len(self, new_len: impl Into<u16>) -> Self
Set an explicit length for the PDU instead of taking it from the sent data.
The length will be the maximum of the value set here and the data sent.
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 send<'data, 'client>(
self,
client: &'client Client<'client>,
data: impl EtherCrabWireWrite,
) -> Result<(), Error>
pub async fn send<'data, 'client>( self, client: &'client Client<'client>, data: impl EtherCrabWireWrite, ) -> Result<(), Error>
Send a payload with a length set by with_len, ignoring the
response.
sourcepub async fn send_receive<'data, 'client, T>(
self,
client: &'client Client<'client>,
value: impl EtherCrabWireWrite,
) -> Result<T, Error>where
T: EtherCrabWireRead,
pub async fn send_receive<'data, 'client, T>(
self,
client: &'client Client<'client>,
value: impl EtherCrabWireWrite,
) -> Result<T, Error>where
T: EtherCrabWireRead,
Send a value, returning the response returned from the network.
sourcepub async fn send_receive_slice<'data, 'client>(
self,
client: &'client Client<'client>,
value: impl EtherCrabWireWrite,
) -> Result<ReceivedPdu<'data, ()>, Error>where
'client: 'data,
pub async fn send_receive_slice<'data, 'client>(
self,
client: &'client Client<'client>,
value: impl EtherCrabWireWrite,
) -> Result<ReceivedPdu<'data, ()>, Error>where
'client: 'data,
Similar to send_receive but returns a slice.
Trait Implementations§
source§impl Clone for WrappedWrite
impl Clone for WrappedWrite
source§fn clone(&self) -> WrappedWrite
fn clone(&self) -> WrappedWrite
Returns a copy of the value. Read more
1.6.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 WrappedWrite
impl Debug for WrappedWrite
source§impl From<WrappedWrite> for Command
impl From<WrappedWrite> for Command
source§fn from(value: WrappedWrite) -> Self
fn from(value: WrappedWrite) -> Self
Converts to this type from the input type.
impl Copy for WrappedWrite
Auto Trait Implementations§
impl Freeze for WrappedWrite
impl RefUnwindSafe for WrappedWrite
impl Send for WrappedWrite
impl Sync for WrappedWrite
impl Unpin for WrappedWrite
impl UnwindSafe for WrappedWrite
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)