Trait capnp_rpc::VatNetwork
source · pub trait VatNetwork<VatId> {
// Required methods
fn connect(&mut self, host_id: VatId) -> Option<Box<dyn Connection<VatId>>>;
fn accept(&mut self) -> Promise<Box<dyn Connection<VatId>>, Error>;
fn drive_until_shutdown(&mut self) -> Promise<(), Error>;
}
Expand description
Network facility between vats, it determines how to form connections between vats.
§Vat
Cap’n Proto RPC operates between vats, where a “vat” is some sort of host of objects. Typically one Cap’n Proto process (in the Unix sense) is one vat.
Required Methods§
sourcefn connect(&mut self, host_id: VatId) -> Option<Box<dyn Connection<VatId>>>
fn connect(&mut self, host_id: VatId) -> Option<Box<dyn Connection<VatId>>>
Connects to host_id
.
Returns None if host_id
refers to the local vat.
sourcefn 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.
sourcefn drive_until_shutdown(&mut self) -> Promise<(), Error>
fn drive_until_shutdown(&mut self) -> Promise<(), Error>
A promise that cannot be resolved until the shutdown.