pub struct RpcSystem<VatId>where
VatId: 'static,{ /* private fields */ }
Expand description
A portal to objects available on the network.
The RPC implemententation sits on top of an implementation of VatNetwork
, which
determines how to form connections between vats. The RPC implementation determines
how to use such connections to manage object references and make method calls.
At the moment, this is all rather more general than it needs to be, because the only
implementation of VatNetwork
is twoparty::VatNetwork
. However, eventually we
will need to have more sophisticated VatNetwork
implementations, in order to support
level 3 features.
An RpcSystem
is a non-Send
able Future
and needs to be driven by a task
executor. A common way accomplish that is to pass the RpcSystem
to
tokio::task::spawn_local()
.
Implementations§
source§impl<VatId> RpcSystem<VatId>
impl<VatId> RpcSystem<VatId>
sourcepub fn new(
network: Box<dyn VatNetwork<VatId>>,
bootstrap: Option<Client>
) -> Self
pub fn new( network: Box<dyn VatNetwork<VatId>>, bootstrap: Option<Client> ) -> Self
Constructs a new RpcSystem
with the given network and bootstrap capability.
sourcepub fn bootstrap<T>(&mut self, vat_id: VatId) -> Twhere
T: FromClientHook,
pub fn bootstrap<T>(&mut self, vat_id: VatId) -> Twhere
T: FromClientHook,
Connects to the given vat and returns its bootstrap interface.
sourcepub fn get_disconnector(&self) -> Disconnector<VatId> ⓘ
pub fn get_disconnector(&self) -> Disconnector<VatId> ⓘ
Returns a Disconnector
future that can be run to cleanly close the connection to this RpcSystem
’s network.
You should get the Disconnector
before you spawn the RpcSystem
.
Trait Implementations§
Auto Trait Implementations§
impl<VatId> !Freeze for RpcSystem<VatId>
impl<VatId> !RefUnwindSafe for RpcSystem<VatId>
impl<VatId> !Send for RpcSystem<VatId>
impl<VatId> !Sync for RpcSystem<VatId>
impl<VatId> Unpin for RpcSystem<VatId>
impl<VatId> !UnwindSafe for RpcSystem<VatId>
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
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn map<U, F>(self, f: F) -> Map<Self, F>
fn map<U, F>(self, f: F) -> Map<Self, F>
source§fn map_into<U>(self) -> MapInto<Self, U>
fn map_into<U>(self) -> MapInto<Self, U>
source§fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>
fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>
f
. Read moresource§fn left_future<B>(self) -> Either<Self, B>
fn left_future<B>(self) -> Either<Self, B>
source§fn right_future<A>(self) -> Either<A, Self>
fn right_future<A>(self) -> Either<A, Self>
source§fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
source§fn flatten(self) -> Flatten<Self>
fn flatten(self) -> Flatten<Self>
source§fn flatten_stream(self) -> FlattenStream<Self>
fn flatten_stream(self) -> FlattenStream<Self>
source§fn fuse(self) -> Fuse<Self>where
Self: Sized,
fn fuse(self) -> Fuse<Self>where
Self: Sized,
poll
will never again be called once it has
completed. This method can be used to turn any Future
into a
FusedFuture
. Read moresource§fn inspect<F>(self, f: F) -> Inspect<Self, F>
fn inspect<F>(self, f: F) -> Inspect<Self, F>
source§fn catch_unwind(self) -> CatchUnwind<Self>where
Self: Sized + UnwindSafe,
fn catch_unwind(self) -> CatchUnwind<Self>where
Self: Sized + UnwindSafe,
source§fn remote_handle(self) -> (Remote<Self>, RemoteHandle<Self::Output>)where
Self: Sized,
fn remote_handle(self) -> (Remote<Self>, RemoteHandle<Self::Output>)where
Self: Sized,
()
on completion and sends
its output to another future on a separate task. Read moresource§fn boxed<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + Send + 'a>>
fn boxed<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + Send + 'a>>
source§fn boxed_local<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + 'a>>where
Self: Sized + 'a,
fn boxed_local<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + 'a>>where
Self: Sized + 'a,
source§fn unit_error(self) -> UnitError<Self>where
Self: Sized,
fn unit_error(self) -> UnitError<Self>where
Self: Sized,
Future<Output = T>
into a
TryFuture<Ok = T, Error = ()
>.source§fn never_error(self) -> NeverError<Self>where
Self: Sized,
fn never_error(self) -> NeverError<Self>where
Self: Sized,
Future<Output = T>
into a
TryFuture<Ok = T, Error = Never
>.