HostOutgoingValue

Trait HostOutgoingValue 

Source
pub trait HostOutgoingValue: Send {
    // Required methods
    fn new_outgoing_value(
        &mut self,
    ) -> impl Future<Output = Result<Resource<OutgoingValue>>> + Send;
    fn outgoing_value_write_body(
        &mut self,
        self_: Resource<OutgoingValue>,
    ) -> impl Future<Output = Result<Result<Resource<OutputStream>, ()>>> + Send;
    fn finish(
        &mut self,
        this: Resource<OutgoingValue>,
    ) -> impl Future<Output = Result<Result<(), Error>>> + Send;
    fn drop(
        &mut self,
        rep: Resource<OutgoingValue>,
    ) -> impl Future<Output = Result<()>> + Send;
}

Required Methods§

Source

fn new_outgoing_value( &mut self, ) -> impl Future<Output = Result<Resource<OutgoingValue>>> + Send

Source

fn outgoing_value_write_body( &mut self, self_: Resource<OutgoingValue>, ) -> impl Future<Output = Result<Result<Resource<OutputStream>, ()>>> + Send

Returns a stream for writing the value contents.

The returned output-stream is a child resource: it must be dropped before the parent outgoing-value resource is dropped (or finished), otherwise the outgoing-value drop or finish will trap.

Returns success on the first call: the output-stream resource for this outgoing-value may be retrieved at most once. Subsequent calls will return error.

Source

fn finish( &mut self, this: Resource<OutgoingValue>, ) -> impl Future<Output = Result<Result<(), Error>>> + Send

Finalize an outgoing value. This must be called to signal that the outgoing value is complete. If the outgoing-value is dropped without calling outgoing-value.finalize, the implementation should treat the value as corrupted.

Source

fn drop( &mut self, rep: Resource<OutgoingValue>, ) -> impl Future<Output = Result<()>> + Send

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<_T: HostOutgoingValue + ?Sized + Send> HostOutgoingValue for &mut _T

Source§

fn outgoing_value_write_body( &mut self, self_: Resource<OutgoingValue>, ) -> impl Future<Output = Result<Result<Resource<OutputStream>, ()>>> + Send

Returns a stream for writing the value contents.

The returned output-stream is a child resource: it must be dropped before the parent outgoing-value resource is dropped (or finished), otherwise the outgoing-value drop or finish will trap.

Returns success on the first call: the output-stream resource for this outgoing-value may be retrieved at most once. Subsequent calls will return error.

Source§

fn finish( &mut self, this: Resource<OutgoingValue>, ) -> impl Future<Output = Result<Result<(), Error>>> + Send

Finalize an outgoing value. This must be called to signal that the outgoing value is complete. If the outgoing-value is dropped without calling outgoing-value.finalize, the implementation should treat the value as corrupted.

Source§

fn new_outgoing_value( &mut self, ) -> impl Future<Output = Result<Resource<OutgoingValue>>> + Send

Source§

async fn drop(&mut self, rep: Resource<OutgoingValue>) -> Result<()>

Implementors§