Trait w5500_hl::io::Write

source ·
pub trait Write<E> {
    // Required methods
    fn write(&mut self, buf: &[u8]) -> Result<u16, E>;
    fn write_all(&mut self, buf: &[u8]) -> Result<(), Error<E>>;
    fn send(self) -> Result<(), E>;
}
Expand description

Socket writer trait.

Required Methods§

source

fn write(&mut self, buf: &[u8]) -> Result<u16, E>

Write data to the socket buffer, and return the number of bytes written.

source

fn write_all(&mut self, buf: &[u8]) -> Result<(), Error<E>>

Writes all the data, returning Error::OutOfMemory if the size of buf exceeds the free memory available in the socket buffer.

Errors

This method can only return:

source

fn send(self) -> Result<(), E>

Send all data previously written with write and write_all.

For UDP sockets the destination is set by the last call to Registers::set_sn_dest, Udp::udp_send_to, or UdpWriter::udp_send_to.

Implementors§

source§

impl<'w, W5500: Registers> Write<<W5500 as Registers>::Error> for TcpWriter<'w, W5500>

source§

impl<'w, W5500: Registers> Write<<W5500 as Registers>::Error> for UdpWriter<'w, W5500>