Struct wasmcloud_control_interface::Client[][src]

pub struct Client { /* fields omitted */ }

Implementations

impl Client[src]

pub fn new(nc: Connection, nsprefix: Option<String>, timeout: Duration) -> Self[src]

Creates a new lattice control interface client

pub async fn get_hosts(
    &self,
    timeout: Duration
) -> Result<Vec<Host>, Box<dyn Error + Send + Sync>>
[src]

Queries the lattice for all responsive hosts, waiting for the full period specified by timeout.

pub async fn perform_actor_auction(
    &self,
    actor_ref: &str,
    constraints: HashMap<String, String>,
    timeout: Duration
) -> Result<Vec<ActorAuctionAck>, Box<dyn Error + Send + Sync>>
[src]

Performs an actor auction within the lattice, publishing a set of constraints and the metadata for the actor in question. This will always wait for the full period specified by duration, and then return the set of gathered results. It is then up to the client to choose from among the “auction winners” to issue the appropriate command to start an actor. Clients cannot assume that auctions will always return at least one result.

pub async fn perform_provider_auction(
    &self,
    provider_ref: &str,
    link_name: &str,
    constraints: HashMap<String, String>,
    timeout: Duration
) -> Result<Vec<ProviderAuctionAck>, Box<dyn Error + Send + Sync>>
[src]

Performs a provider auction within the lattice, publishing a set of constraints and the metadata for the provider in question. This will always wait for the full period specified by duration, and then return the set of gathered results. It is then up to the client to choose from among the “auction winners” and issue the appropriate command to start a provider. Clients cannot assume that auctions will always return at least one result.

pub async fn get_host_inventory(
    &self,
    host_id: &str
) -> Result<HostInventory, Box<dyn Error + Send + Sync>>
[src]

Retrieves the contents of a running host

pub async fn start_actor(
    &self,
    host_id: &str,
    actor_ref: &str
) -> Result<StartActorAck, Box<dyn Error + Send + Sync>>
[src]

Sends a request to the given host to start a given actor by its OCI reference. This returns an acknowledgement of receipt of the command, not a confirmation that the actor started. An acknowledgement will either indicate some form of validation failure, or, if no failure occurs, the receipt of the command. To avoid blocking consumers, wasmCloud hosts will acknowledge the start actor command prior to fetching the actor’s OCI bytes. If a client needs deterministic results as to whether the actor completed its startup process, the client will have to monitor the appropriate event in the control event stream

pub async fn call_actor(
    &self,
    target_id: &str,
    operation: &str,
    data: &[u8]
) -> Result<InvocationResponse, Box<dyn Error + Send + Sync>>
[src]

Performs a remote procedure call over the lattice, targeting the given actor. This call will appear to originate from the “system” actor and from a unique host ID that was generated by the control interface client when it was instantiated. If there are multiple actors with the same public key actively running in the lattice, then the message broker is responsible for choosing the appropriate target. Under current NATS implementations, that means an actor is chosen psuedo-randomly among the known queue subscribers, and will not be invoked in round-robin fashion

Publishes the link advertisement message to the lattice that is published when code invokes the set_link function on a Host struct instance. No confirmation or acknowledgement is available for this operation because it is publish-only.

pub async fn update_actor(
    &self,
    host_id: &str,
    existing_actor_id: &str,
    new_actor_ref: &str
) -> Result<UpdateActorAck, Box<dyn Error + Send + Sync>>
[src]

Issue a command to a host instructing that it replace an existing actor (indicated by its public key) with a new actor indicated by an OCI image reference. The host will acknowledge this request as soon as it verifies that the target actor is running. This acknowledgement occurs before the new bytes are downloaded. Live-updating an actor can take a long time and control clients cannot block waiting for a reply that could come several seconds later. If you need to verify that the actor has been updated, you will want to set up a listener for the appropriate ControlEvent which will be published on the control events channel in JSON

pub async fn start_provider(
    &self,
    host_id: &str,
    provider_ref: &str,
    link_name: Option<String>
) -> Result<StartProviderAck, Box<dyn Error + Send + Sync>>
[src]

Issues a command to a host to start a provider with a given OCI reference using the specified link name (or “default” if none is specified). The target wasmCloud host will acknowledge the receipt of this command before downloading the provider’s bytes from the OCI registry, indicating either a validation failure or success. If a client needs deterministic guarantees that the provider has completed its startup process, such a client needs to monitor the control event stream for the appropriate event

pub async fn stop_provider(
    &self,
    host_id: &str,
    provider_ref: &str,
    link_name: &str,
    contract_id: &str
) -> Result<StopProviderAck, Box<dyn Error + Send + Sync>>
[src]

Issues a command to a host to stop a provider for the given OCI reference, link name, and contract ID. The target wasmCloud host will acknowledge the receipt of this command, and will not supply a discrete confirmation that a provider has terminated. For that kind of information, the client must also monitor the control event stream

pub async fn stop_actor(
    &self,
    host_id: &str,
    actor_ref: &str
) -> Result<StopActorAck, Box<dyn Error + Send + Sync>>
[src]

Issues a command to a host to stop an actor for the given OCI reference. The target wasmCloud host will acknowledge the receipt of this command, and will not supply a discrete confirmation that the actor has terminated. For that kind of information, the client must also monitor the control event stream

pub async fn get_claims(
    &self
) -> Result<ClaimsList, Box<dyn Error + Send + Sync>>
[src]

Retrieves the full set of all cached claims in the lattice by getting a response from the first host that answers this query

Auto Trait Implementations

impl !RefUnwindSafe for Client

impl Send for Client

impl Sync for Client

impl Unpin for Client

impl !UnwindSafe for Client

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,