[][src]Trait fizyr_rpc::transport::TransportWriteHalf

pub trait TransportWriteHalf: Send + Unpin {
    type Body: Body;
    fn poll_write_msg(
        self: Pin<&mut Self>,
        context: &mut Context<'_>,
        header: &MessageHeader,
        body: &Self::Body
    ) -> Poll<Result<(), WriteMessageError>>; fn write_msg<'c>(
        &'c mut self,
        header: &'c MessageHeader,
        body: &'c Self::Body
    ) -> WriteMsg<'_, Self>

Notable traits for WriteMsg<'_, T>

impl<T: ?Sized> Future for WriteMsg<'_, T> where
    T: TransportWriteHalf + Unpin
type Output = Result<(), WriteMessageError>;
{ ... } }

Trait for transport types that you can write message to.

Associated Types

type Body: Body[src]

The body type for messages transferred over the transport.

Loading content...

Required methods

fn poll_write_msg(
    self: Pin<&mut Self>,
    context: &mut Context<'_>,
    header: &MessageHeader,
    body: &Self::Body
) -> Poll<Result<(), WriteMessageError>>
[src]

Try to write a message to the transport without blocking.

This function may write only part of the message. The next invocation will skip the already written bytes.

It is an error to change the value of the header and body parameters between invocations as long as the function returns Poll::Pending. An implementation may write spliced messages over the transport if you do. It is allowed to move the header and body in between invocations though, as long as the values remain the same.

If the function returns Poll::Pending, the current task is scheduled to wake when the transport is ready for more data.

Loading content...

Provided methods

fn write_msg<'c>(
    &'c mut self,
    header: &'c MessageHeader,
    body: &'c Self::Body
) -> WriteMsg<'_, Self>

Notable traits for WriteMsg<'_, T>

impl<T: ?Sized> Future for WriteMsg<'_, T> where
    T: TransportWriteHalf + Unpin
type Output = Result<(), WriteMessageError>;
[src]

Asynchronously write a message to the transport.

Loading content...

Implementations on Foreign Types

impl<T: ?Sized> TransportWriteHalf for &mut T where
    T: TransportWriteHalf + Unpin
[src]

type Body = T::Body

impl<T: ?Sized> TransportWriteHalf for Box<T> where
    T: TransportWriteHalf + Unpin
[src]

type Body = T::Body

impl<P> TransportWriteHalf for Pin<P> where
    P: DerefMut + Send + Unpin,
    P::Target: TransportWriteHalf
[src]

type Body = <P::Target as TransportWriteHalf>::Body

Loading content...

Implementors

Loading content...