Struct capnp_rpc::twoparty::VatNetwork
source · pub struct VatNetwork<T>{ /* private fields */ }
Expand description
A vat network with two parties, the client and the server.
Implementations§
source§impl<T> VatNetwork<T>
impl<T> VatNetwork<T>
sourcepub fn new<U>(
input_stream: T,
output_stream: U,
side: Side,
receive_options: ReaderOptions
) -> Selfwhere
U: AsyncWrite + 'static + Unpin,
pub fn new<U>(
input_stream: T,
output_stream: U,
side: Side,
receive_options: ReaderOptions
) -> Selfwhere
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>
impl<T> VatNetwork<Side> for VatNetwork<T>
source§fn connect(&mut self, host_id: VatId) -> Option<Box<dyn Connection<VatId>>>
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>
fn accept(&mut self) -> Promise<Box<dyn Connection<VatId>>, Error>
Waits for the next incoming connection and return it.
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> 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