ethercrab

Struct WrappedWrite

source
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: Writes

EtherCAT command.

Implementations§

source§

impl WrappedWrite

source

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.

source

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.

source

pub fn with_wkc(self, wkc: u16) -> Self

Change the expected working counter from its default of 1.

source

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.

source

pub async fn send_receive<'data, 'client, T>( self, client: &'client Client<'client>, value: impl EtherCrabWireWrite, ) -> Result<T, Error>

Send a value, returning the response returned from the network.

source

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

source§

fn clone(&self) -> WrappedWrite

Returns a copy of the value. Read more
1.6.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WrappedWrite

source§

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

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

impl From<WrappedWrite> for Command

source§

fn from(value: WrappedWrite) -> Self

Converts to this type from the input type.
source§

impl Copy for WrappedWrite

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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more