[][src]Trait breadx::display::Connection

pub trait Connection {
    pub fn send_packet(&mut self, bytes: &[u8]) -> Result;
pub fn read_packet(&mut self, bytes: &mut [u8]) -> Result;
#[must_use] pub fn send_packet_async<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        bytes: &'life1 [u8]
    ) -> Pin<Box<dyn Future<Output = Result> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
#[must_use] pub fn read_packet_async<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        bytes: &'life1 mut [u8]
    ) -> Pin<Box<dyn Future<Output = Result> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; }

A trait that represents the ability to send and receive bytes across a connection. This is used as a two-way stream to send and receive data from the X server.

Required methods

pub fn send_packet(&mut self, bytes: &[u8]) -> Result[src]

Send bytes in a packet across the connection in a blocking manner.

pub fn read_packet(&mut self, bytes: &mut [u8]) -> Result[src]

Read a packet/request from the connection in a blocking manner.

#[must_use]pub fn send_packet_async<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    bytes: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Send bytes in a packet across the connection in an async manner.

#[must_use]pub fn read_packet_async<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    bytes: &'life1 mut [u8]
) -> Pin<Box<dyn Future<Output = Result> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Read a packet/request from the connection in an async manner.

Loading content...

Implementations on Foreign Types

impl Connection for TcpStream[src]

impl Connection for AsyncTcpStream[src]

impl Connection for UnixStream[src]

impl Connection for AsyncUnixStream[src]

Loading content...

Implementors

impl Connection for NameConnection[src]

Loading content...