pub trait FramedConnection:
Send
+ Sync
+ Debug {
// Required methods
fn send_frame<'life0, 'async_trait>(
&'life0 self,
data: Bytes,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn recv_frame<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn close<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn send_frame_with_fds<'life0, 'life1, 'async_trait>(
&'life0 self,
data: Bytes,
fds: &'life1 [RawFd],
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn recv_frame_with_fds<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<(Bytes, Vec<RawFd>)>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
A framed, length-delimited, duplex connection. Multiplexing is layered above this.
Required Methods§
Sourcefn send_frame<'life0, 'async_trait>(
&'life0 self,
data: Bytes,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_frame<'life0, 'async_trait>(
&'life0 self,
data: Bytes,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send one frame.
Provided Methods§
Sourcefn send_frame_with_fds<'life0, 'life1, 'async_trait>(
&'life0 self,
data: Bytes,
fds: &'life1 [RawFd],
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_frame_with_fds<'life0, 'life1, 'async_trait>(
&'life0 self,
data: Bytes,
fds: &'life1 [RawFd],
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send one frame with file descriptors (Unix SCM_RIGHTS).
On platforms that don’t support FD passing, this returns an error if any FDs are provided.
Sourcefn recv_frame_with_fds<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<(Bytes, Vec<RawFd>)>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn recv_frame_with_fds<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<(Bytes, Vec<RawFd>)>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Receive one frame with file descriptors (Unix SCM_RIGHTS).
Returns the frame and any received FDs. On platforms that don’t support FD passing, the FD vec will always be empty.
Implementations on Foreign Types§
Source§impl<T: FramedConnection + ?Sized> FramedConnection for Arc<T>
Blanket implementation of FramedConnection for Arc<T> where T
implements FramedConnection. This allows wrapping connections in Arc
for cloning while still using the trait methods.
impl<T: FramedConnection + ?Sized> FramedConnection for Arc<T>
Blanket implementation of FramedConnection for Arc<T> where T
implements FramedConnection. This allows wrapping connections in Arc
for cloning while still using the trait methods.