Struct wasmbus_rpc::provider::HostBridge
source · [−]pub struct HostBridge { /* private fields */ }
Expand description
HostBridge manages the NATS connection to the host, and processes subscriptions for links, health-checks, and rpc messages. Callbacks from HostBridge are implemented by the provider in the [ProviderHandler] implementation.
Implementations
sourceimpl HostBridge
impl HostBridge
pub fn new(
nats: Connection,
host_data: &HostData
) -> Result<HostBridge, RpcError>
sourcepub fn provider_key(&self) -> &str
pub fn provider_key(&self) -> &str
Returns the provider’s public key
sourceimpl HostBridge
impl HostBridge
sourcepub async fn put_link(&self, ld: LinkDefinition)
pub async fn put_link(&self, ld: LinkDefinition)
Stores actor with link definition
sourcepub async fn delete_link(&self, actor_id: &str)
pub async fn delete_link(&self, actor_id: &str)
Deletes link
sourcepub async fn get_link(&self, actor_id: &str) -> Option<LinkDefinition>
pub async fn get_link(&self, actor_id: &str) -> Option<LinkDefinition>
Returns copy of LinkDefinition, or None,if the actor is not linked
sourcepub async fn connect<P>(
&'static self,
provider: P,
shutdown_tx: Sender<HostShutdownEvent>
) -> Result<JoinAll<JoinHandle<Result<(), RpcError>>>, RpcError> where
P: ProviderDispatch + Send + Sync + Clone + 'static,
pub async fn connect<P>(
&'static self,
provider: P,
shutdown_tx: Sender<HostShutdownEvent>
) -> Result<JoinAll<JoinHandle<Result<(), RpcError>>>, RpcError> where
P: ProviderDispatch + Send + Sync + Clone + 'static,
Implement subscriber listener threads and provider callbacks
pub async fn validate_invocation(&self, inv: &Invocation) -> Result<(), String>
Trait Implementations
sourceimpl Clone for HostBridge
impl Clone for HostBridge
sourcefn clone(&self) -> HostBridge
fn clone(&self) -> HostBridge
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl !RefUnwindSafe for HostBridge
impl Send for HostBridge
impl Sync for HostBridge
impl Unpin for HostBridge
impl !UnwindSafe for HostBridge
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more