pub struct UnixSocketConnection { /* private fields */ }Expand description
Unix socket connection
Implementations§
Source§impl UnixSocketConnection
impl UnixSocketConnection
Sourcepub fn from_stream(stream: UnixStream) -> Self
pub fn from_stream(stream: UnixStream) -> Self
Wrap an accepted (server-side) stream.
Sourcepub async fn connect(path: PathBuf) -> TransportResult<Self>
pub async fn connect(path: PathBuf) -> TransportResult<Self>
Create a new connection as a client
Sourcepub async fn read_message(&mut self) -> TransportResult<Vec<u8>>
pub async fn read_message(&mut self) -> TransportResult<Vec<u8>>
Read a message from the connection
Sourcepub async fn write_message(&mut self, data: &[u8]) -> TransportResult<()>
pub async fn write_message(&mut self, data: &[u8]) -> TransportResult<()>
Write a message to the connection
Sourcepub async fn close(&mut self) -> TransportResult<()>
pub async fn close(&mut self) -> TransportResult<()>
Close the connection
Auto Trait Implementations§
impl !Freeze for UnixSocketConnection
impl RefUnwindSafe for UnixSocketConnection
impl Send for UnixSocketConnection
impl Sync for UnixSocketConnection
impl Unpin for UnixSocketConnection
impl UnsafeUnpin for UnixSocketConnection
impl UnwindSafe for UnixSocketConnection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more