Skip to main content

P9Transport

Trait P9Transport 

Source
pub trait P9Transport {
    // Required methods
    fn send<'life0, 'life1, 'async_trait>(
        &'life0 self,
        data: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn recv<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Transport trait for sending/receiving 9P messages.

Implementations provide the actual byte transport (DMA ring, socket, etc.). Messages are already length-prefixed by the 9P serializer.

The trait is Send on native targets — so a socket-backed transport can back a Send + Sync Mount — and ?Send on wasm32, where the DMA transport is single-threaded. This mirrors the Mount trait’s own cfg_attr split.

Required Methods§

Source

fn send<'life0, 'life1, 'async_trait>( &'life0 self, data: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Send a complete 9P message (including length prefix).

Source

fn recv<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Receive a complete 9P message (including length prefix).

Implementors§

Source§

impl<S> P9Transport for SocketTransport<S>
where S: AsyncRead + AsyncWrite + Send + 'static,