Trait EtherCrabWireWrite

Source
pub trait EtherCrabWireWrite {
    // Required methods
    fn pack_to_slice_unchecked<'buf>(&self, buf: &'buf mut [u8]) -> &'buf [u8] ;
    fn packed_len(&self) -> usize;

    // Provided method
    fn pack_to_slice<'buf>(
        &self,
        buf: &'buf mut [u8],
    ) -> Result<&'buf [u8], WireError> { ... }
}
Expand description

A type to be sent/received on the wire, according to EtherCAT spec rules (packed bits, little endian).

This trait is derivable.

Required Methods§

Source

fn pack_to_slice_unchecked<'buf>(&self, buf: &'buf mut [u8]) -> &'buf [u8]

Pack the type and write it into the beginning of buf.

§Panics

This method must panic if buf is too short to hold the packed data.

Source

fn packed_len(&self) -> usize

Get the length in bytes of this item when packed.

Provided Methods§

Source

fn pack_to_slice<'buf>( &self, buf: &'buf mut [u8], ) -> Result<&'buf [u8], WireError>

Pack the type and write it into the beginning of buf.

The default implementation of this method will return an error if the buffer is not long enough.

Implementations on Foreign Types§

Source§

impl EtherCrabWireWrite for &[u8]

Source§

fn pack_to_slice_unchecked<'buf>(&self, buf: &'buf mut [u8]) -> &'buf [u8]

Source§

fn packed_len(&self) -> usize

Source§

impl EtherCrabWireWrite for bool

Source§

fn pack_to_slice_unchecked<'buf>(&self, buf: &'buf mut [u8]) -> &'buf [u8]

Source§

fn packed_len(&self) -> usize

Source§

impl EtherCrabWireWrite for f32

Source§

fn pack_to_slice_unchecked<'buf>(&self, buf: &'buf mut [u8]) -> &'buf [u8]

Source§

fn pack_to_slice<'buf>( &self, buf: &'buf mut [u8], ) -> Result<&'buf [u8], WireError>

Source§

fn packed_len(&self) -> usize

Source§

impl EtherCrabWireWrite for f64

Source§

fn pack_to_slice_unchecked<'buf>(&self, buf: &'buf mut [u8]) -> &'buf [u8]

Source§

fn pack_to_slice<'buf>( &self, buf: &'buf mut [u8], ) -> Result<&'buf [u8], WireError>

Source§

fn packed_len(&self) -> usize

Source§

impl EtherCrabWireWrite for i8

Source§

fn pack_to_slice_unchecked<'buf>(&self, buf: &'buf mut [u8]) -> &'buf [u8]

Source§

fn pack_to_slice<'buf>( &self, buf: &'buf mut [u8], ) -> Result<&'buf [u8], WireError>

Source§

fn packed_len(&self) -> usize

Source§

impl EtherCrabWireWrite for i16

Source§

fn pack_to_slice_unchecked<'buf>(&self, buf: &'buf mut [u8]) -> &'buf [u8]

Source§

fn pack_to_slice<'buf>( &self, buf: &'buf mut [u8], ) -> Result<&'buf [u8], WireError>

Source§

fn packed_len(&self) -> usize

Source§

impl EtherCrabWireWrite for i32

Source§

fn pack_to_slice_unchecked<'buf>(&self, buf: &'buf mut [u8]) -> &'buf [u8]

Source§

fn pack_to_slice<'buf>( &self, buf: &'buf mut [u8], ) -> Result<&'buf [u8], WireError>

Source§

fn packed_len(&self) -> usize

Source§

impl EtherCrabWireWrite for i64

Source§

fn pack_to_slice_unchecked<'buf>(&self, buf: &'buf mut [u8]) -> &'buf [u8]

Source§

fn pack_to_slice<'buf>( &self, buf: &'buf mut [u8], ) -> Result<&'buf [u8], WireError>

Source§

fn packed_len(&self) -> usize

Source§

impl EtherCrabWireWrite for u8

Source§

fn pack_to_slice_unchecked<'buf>(&self, buf: &'buf mut [u8]) -> &'buf [u8]

Source§

fn pack_to_slice<'buf>( &self, buf: &'buf mut [u8], ) -> Result<&'buf [u8], WireError>

Source§

fn packed_len(&self) -> usize

Source§

impl EtherCrabWireWrite for u16

Source§

fn pack_to_slice_unchecked<'buf>(&self, buf: &'buf mut [u8]) -> &'buf [u8]

Source§

fn pack_to_slice<'buf>( &self, buf: &'buf mut [u8], ) -> Result<&'buf [u8], WireError>

Source§

fn packed_len(&self) -> usize

Source§

impl EtherCrabWireWrite for u32

Source§

fn pack_to_slice_unchecked<'buf>(&self, buf: &'buf mut [u8]) -> &'buf [u8]

Source§

fn pack_to_slice<'buf>( &self, buf: &'buf mut [u8], ) -> Result<&'buf [u8], WireError>

Source§

fn packed_len(&self) -> usize

Source§

impl EtherCrabWireWrite for u64

Source§

fn pack_to_slice_unchecked<'buf>(&self, buf: &'buf mut [u8]) -> &'buf [u8]

Source§

fn pack_to_slice<'buf>( &self, buf: &'buf mut [u8], ) -> Result<&'buf [u8], WireError>

Source§

fn packed_len(&self) -> usize

Source§

impl EtherCrabWireWrite for ()

Source§

fn pack_to_slice_unchecked<'buf>(&self, _buf: &'buf mut [u8]) -> &'buf [u8]

Source§

fn packed_len(&self) -> usize

Source§

impl<T0> EtherCrabWireWrite for (T0,)

Source§

fn pack_to_slice_unchecked<'buf>(&self, orig: &'buf mut [u8]) -> &'buf [u8]

Source§

fn packed_len(&self) -> usize

Source§

impl<T0, T1> EtherCrabWireWrite for (T0, T1)

Source§

fn pack_to_slice_unchecked<'buf>(&self, orig: &'buf mut [u8]) -> &'buf [u8]

Source§

fn packed_len(&self) -> usize

Source§

impl<T0, T1, T2> EtherCrabWireWrite for (T0, T1, T2)

Source§

fn pack_to_slice_unchecked<'buf>(&self, orig: &'buf mut [u8]) -> &'buf [u8]

Source§

fn packed_len(&self) -> usize

Source§

impl<T0, T1, T2, T3> EtherCrabWireWrite for (T0, T1, T2, T3)

Source§

fn pack_to_slice_unchecked<'buf>(&self, orig: &'buf mut [u8]) -> &'buf [u8]

Source§

fn packed_len(&self) -> usize

Source§

impl<T0, T1, T2, T3, T4> EtherCrabWireWrite for (T0, T1, T2, T3, T4)

Source§

fn pack_to_slice_unchecked<'buf>(&self, orig: &'buf mut [u8]) -> &'buf [u8]

Source§

fn packed_len(&self) -> usize

Source§

impl<T0, T1, T2, T3, T4, T5> EtherCrabWireWrite for (T0, T1, T2, T3, T4, T5)

Source§

fn pack_to_slice_unchecked<'buf>(&self, orig: &'buf mut [u8]) -> &'buf [u8]

Source§

fn packed_len(&self) -> usize

Source§

impl<T0, T1, T2, T3, T4, T5, T6> EtherCrabWireWrite for (T0, T1, T2, T3, T4, T5, T6)

Source§

fn pack_to_slice_unchecked<'buf>(&self, orig: &'buf mut [u8]) -> &'buf [u8]

Source§

fn packed_len(&self) -> usize

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7> EtherCrabWireWrite for (T0, T1, T2, T3, T4, T5, T6, T7)

Source§

fn pack_to_slice_unchecked<'buf>(&self, orig: &'buf mut [u8]) -> &'buf [u8]

Source§

fn packed_len(&self) -> usize

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8> EtherCrabWireWrite for (T0, T1, T2, T3, T4, T5, T6, T7, T8)

Source§

fn pack_to_slice_unchecked<'buf>(&self, orig: &'buf mut [u8]) -> &'buf [u8]

Source§

fn packed_len(&self) -> usize

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> EtherCrabWireWrite for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)

Source§

fn pack_to_slice_unchecked<'buf>(&self, orig: &'buf mut [u8]) -> &'buf [u8]

Source§

fn packed_len(&self) -> usize

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> EtherCrabWireWrite for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)

Source§

fn pack_to_slice_unchecked<'buf>(&self, orig: &'buf mut [u8]) -> &'buf [u8]

Source§

fn packed_len(&self) -> usize

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> EtherCrabWireWrite for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)

Source§

fn pack_to_slice_unchecked<'buf>(&self, orig: &'buf mut [u8]) -> &'buf [u8]

Source§

fn packed_len(&self) -> usize

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> EtherCrabWireWrite for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)

Source§

fn pack_to_slice_unchecked<'buf>(&self, orig: &'buf mut [u8]) -> &'buf [u8]

Source§

fn packed_len(&self) -> usize

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> EtherCrabWireWrite for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)

Source§

fn pack_to_slice_unchecked<'buf>(&self, orig: &'buf mut [u8]) -> &'buf [u8]

Source§

fn packed_len(&self) -> usize

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> EtherCrabWireWrite for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)

Source§

fn pack_to_slice_unchecked<'buf>(&self, orig: &'buf mut [u8]) -> &'buf [u8]

Source§

fn packed_len(&self) -> usize

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> EtherCrabWireWrite for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)

Source§

fn pack_to_slice_unchecked<'buf>(&self, orig: &'buf mut [u8]) -> &'buf [u8]

Source§

fn packed_len(&self) -> usize

Source§

impl<T> EtherCrabWireWrite for &T

Source§

fn pack_to_slice_unchecked<'buf>(&self, buf: &'buf mut [u8]) -> &'buf [u8]

Source§

fn packed_len(&self) -> usize

Source§

impl<const N: usize> EtherCrabWireWrite for [u8; N]

Source§

fn pack_to_slice_unchecked<'buf>(&self, buf: &'buf mut [u8]) -> &'buf [u8]

Source§

fn packed_len(&self) -> usize

Implementors§