Struct capnp_rpc::twoparty::VatNetwork

source ·
pub struct VatNetwork<T>
where T: AsyncRead + 'static + Unpin,
{ /* private fields */ }
Expand description

A vat network with two parties, the client and the server.

Implementations§

source§

impl<T> VatNetwork<T>
where T: AsyncRead + Unpin,

source

pub fn new<U>( input_stream: T, output_stream: U, side: Side, receive_options: ReaderOptions ) -> Self
where U: AsyncWrite + 'static + Unpin,

Creates a new two-party vat network that will receive data on input_stream and send data on output_stream.

side indicates whether this is the client or the server side of the connection. This has no effect on the data sent over the connection; it merely exists so that RpcNetwork::bootstrap knows whether to return the local or the remote bootstrap capability. VatId parameters like this one will make more sense once we have vat networks with more than two parties.

The options in receive_options will be used when reading the messages that come in on input_stream.

Trait Implementations§

source§

impl<T> VatNetwork<Side> for VatNetwork<T>
where T: AsyncRead + Unpin,

source§

fn connect(&mut self, host_id: VatId) -> Option<Box<dyn Connection<VatId>>>

Returns None if hostId refers to the local vat.
source§

fn accept(&mut self) -> Promise<Box<dyn Connection<VatId>>, Error>

Waits for the next incoming connection and return it.
source§

fn drive_until_shutdown(&mut self) -> Promise<(), Error>

Auto Trait Implementations§

§

impl<T> Freeze for VatNetwork<T>

§

impl<T> !RefUnwindSafe for VatNetwork<T>

§

impl<T> !Send for VatNetwork<T>

§

impl<T> !Sync for VatNetwork<T>

§

impl<T> Unpin for VatNetwork<T>

§

impl<T> !UnwindSafe for VatNetwork<T>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.