pub struct Exposed { /* private fields */ }Expand description
A service’s one outbound socket to a relay: what it serves there, and
the calls it makes over it. Cheap to clone; Self::serve holds a weak
reference, so the socket goes with the last clone (or Self::stop).
Implementations§
Source§impl Exposed
impl Exposed
Sourcepub fn new(opts: DialOut) -> Self
pub fn new(opts: DialOut) -> Self
Not dialed until Self::serve: an activation that calls out through
the relay holds a clone of this before it is served.
Sourcepub fn principal(&self) -> Result<String, String>
pub fn principal(&self) -> Result<String, String>
The principal this side signs in as (its key’s), or why the key does not read.
Sourcepub async fn mounted(&self, timeout: Duration) -> Result<String, String>
pub async fn mounted(&self, timeout: Duration) -> Result<String, String>
Wait until mounted (its path at the relay), or refused, or timeout.
Sourcepub fn serve<A: Activation + Clone>(&self, activation: A)
pub fn serve<A: Activation + Clone>(&self, activation: A)
Dial, offer activation, serve it; dial again whenever the socket
drops. Replaces a previous serve.
Sourcepub async fn call(&self, method: &str, params: Value) -> PlexusStream
pub async fn call(&self, method: &str, params: Value) -> PlexusStream
Call method (a path at the relay: peers.bob.hello, peers.list)
over this side’s socket, as this side’s key: {svc}.call, decided by
the relay’s gate. Not connected: one child_unavailable item.