Struct UnixSocketTransport

Source
pub struct UnixSocketTransport { /* private fields */ }
Expand description

Represents a Transport that leverages a Unix socket

Implementations§

Source§

impl UnixSocketTransport

Source

pub async fn connect(path: impl AsRef<Path>) -> Result<Self>

Creates a new stream by connecting to the specified path

Source

pub fn path(&self) -> &Path

Returns the path to the socket

Trait Implementations§

Source§

impl Debug for UnixSocketTransport

Source§

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

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

impl Reconnectable for UnixSocketTransport

Source§

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

Attempts to reconnect an already-established connection.
Source§

impl Transport for UnixSocketTransport

Source§

fn try_read(&self, buf: &mut [u8]) -> Result<usize>

Tries to read data from the transport into the provided buffer, returning how many bytes were read. Read more
Source§

fn try_write(&self, buf: &[u8]) -> Result<usize>

Try to write a buffer to the transport, returning how many bytes were written. Read more
Source§

fn ready<'life0, 'async_trait>( &'life0 self, interest: Interest, ) -> Pin<Box<dyn Future<Output = Result<Ready>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Waits for the transport to be ready based on the given interest, returning the ready status.

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> AsAny for T
where T: 'static,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts reference to Any
Source§

fn as_mut_any(&mut self) -> &mut (dyn Any + 'static)

Converts mutable reference to Any
Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Consumes and produces Box<dyn Any>
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> Connector for T
where T: Transport + 'static,

Source§

type Transport = T

Type of transport produced by the connection.
Source§

fn connect<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = Result<<T as Connector>::Transport, Error>> + Send + 'async_trait>>
where T: 'async_trait,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> TransportExt for T
where T: Transport,

Source§

fn readable<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Waits for the transport to be readable to follow up with try_read.
Source§

fn writeable<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Waits for the transport to be writeable to follow up with try_write.
Source§

fn readable_or_writeable<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Waits for the transport to be either readable or writeable.
Source§

fn read_exact<'life0, 'life1, 'async_trait>( &'life0 self, buf: &'life1 mut [u8], ) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait,

Reads exactly n bytes where n is the length of buf by continuing to call try_read until completed. Calls to readable are made to ensure the transport is ready. Returns the total bytes read.
Source§

fn read_to_end<'life0, 'life1, 'async_trait>( &'life0 self, buf: &'life1 mut Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait,

Reads all bytes until EOF in this source, placing them into buf. Read more
Source§

fn read_to_string<'life0, 'life1, 'async_trait>( &'life0 self, buf: &'life1 mut String, ) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait,

Reads all bytes until EOF in this source, placing them into buf. Read more
Source§

fn write_all<'life0, 'life1, 'async_trait>( &'life0 self, buf: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait,

Writes all of buf by continuing to call try_write until completed. Calls to [writeable] are made to ensure the transport is ready.
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V