pub struct LocalStream;
Expand description
The stream-oriented UNIX domain protocol.
§Example
Create a server and client sockets.
use asyncio::{IoContext, Endpoint};
use asyncio::local::{LocalStream, LocalStreamEndpoint, LocalStreamSocket, LocalStreamListener};
let ctx = &IoContext::new().unwrap();
let ep = LocalStreamEndpoint::new("example.sock").unwrap();
let sv = LocalStreamListener::new(ctx, LocalStream).unwrap();
sv.bind(&ep).unwrap();
sv.listen().unwrap();
let cl = LocalStreamSocket::new(ctx, ep.protocol()).unwrap();
cl.connect(&ep).unwrap();
Trait Implementations§
Source§impl Clone for LocalStream
impl Clone for LocalStream
Source§fn clone(&self) -> LocalStream
fn clone(&self) -> LocalStream
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for LocalStream
impl Debug for LocalStream
Source§impl Endpoint<LocalStream> for LocalEndpoint<LocalStream>
impl Endpoint<LocalStream> for LocalEndpoint<LocalStream>
fn protocol(&self) -> LocalStream
Source§impl LocalProtocol for LocalStream
impl LocalProtocol for LocalStream
type Socket = StreamSocket<LocalStream>
Source§impl Ord for LocalStream
impl Ord for LocalStream
Source§fn cmp(&self, other: &LocalStream) -> Ordering
fn cmp(&self, other: &LocalStream) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for LocalStream
impl PartialEq for LocalStream
Source§impl PartialOrd for LocalStream
impl PartialOrd for LocalStream
Source§impl Protocol for LocalStream
impl Protocol for LocalStream
type Endpoint = LocalEndpoint<LocalStream>
Source§fn family_type(&self) -> i32
fn family_type(&self) -> i32
Reurns a value suitable for passing as the domain argument.
Source§fn socket_type(&self) -> i32
fn socket_type(&self) -> i32
Returns a value suitable for passing as the type argument.
Source§fn protocol_type(&self) -> i32
fn protocol_type(&self) -> i32
Returns a value suitable for passing as the protocol argument.
unsafe fn uninitialized(&self) -> Self::Endpoint
impl Eq for LocalStream
impl StructuralPartialEq for LocalStream
Auto Trait Implementations§
impl Freeze for LocalStream
impl RefUnwindSafe for LocalStream
impl Send for LocalStream
impl Sync for LocalStream
impl Unpin for LocalStream
impl UnwindSafe for LocalStream
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