[][src]Struct latticeclient::Client

pub struct Client { /* fields omitted */ }

A client for interacting with the lattice

Implementations

impl Client[src]

pub fn new(
    host: &str,
    credsfile: Option<PathBuf>,
    call_timeout: Duration,
    namespace: Option<String>
) -> Self
[src]

Creates a new lattice client, connecting to the NATS server at the given host with an optional set of credentials (JWT auth)

pub fn with_connection(
    nc: Connection,
    call_timeout: Duration,
    namespace: Option<String>
) -> Self
[src]

pub fn get_hosts(&self) -> Result<Vec<HostProfile>, Box<dyn Error>>[src]

Retrieves the list of all hosts running within the lattice. If it takes a host longer than the call timeout period to reply to the probe, it will not be included in the list of hosts.

pub fn get_bindings(
    &self
) -> Result<HashMap<String, Vec<Binding>>, Box<dyn Error>>
[src]

Retrieves a list of all bindings from actors to capabilities within the lattice (provided the host responds to the probe within the client timeout period)

pub fn get_actors(
    &self
) -> Result<HashMap<String, Vec<Claims<Actor>>>, Box<dyn Error>>
[src]

Retrieves the list of all actors currently running within the lattice (as discovered within the client timeout period)

pub fn get_capabilities(
    &self
) -> Result<HashMap<String, Vec<HostedCapability>>, Box<dyn Error>>
[src]

Retrieves the list of all capabilities within the lattice (discovery limited by the client timeout period)

pub fn watch_events(
    &self,
    sender: Sender<BusEvent>
) -> Result<(), Box<dyn Error>>
[src]

Watches the lattice for bus events. This will create a subscription in a background thread, so callers are responsible for ensuring their process remains alive however long is appropriate. Pass the sender half of a channel to receive the events

pub fn perform_actor_launch_auction(
    &self,
    actor_id: &str,
    constraints: HashMap<String, String>
) -> Result<Vec<LaunchAuctionResponse>, Box<dyn Error>>
[src]

Performs an auction among all hosts on the lattice, requesting that the given actor be launched (loaded+started) on a suitable host as described by the set of constraints. Only hosts that believe they can launch the actor will reply. In other words, there will be no negative responses in the result vector, only a list of suitable hosts. The actor to be launched is identified by an OCI registry reference

pub fn perform_provider_launch_auction(
    &self,
    provider_ref: &str,
    binding_name: &str,
    constraints: HashMap<String, String>
) -> Result<Vec<ProviderAuctionResponse>, Box<dyn Error>>
[src]

Performs an auction among all hosts on the lattice, requesting that the given capability provider (indicated by OCI image reference) be loaded/started. Hosts that believe they can host the provider given the constraints will respond to the auction

pub fn launch_provider_on_host(
    &self,
    provider_ref: &str,
    host_id: &str,
    binding_name: &str
) -> Result<ProviderLaunchAck, Box<dyn Error>>
[src]

After collecting the results of a provider launch auction, a "winner" from among the hosts can be selected and told to launch the given provider. The provider's bytes will be retrieved from the OCI registry. This function does not confirm successful launch, only receipt of the launch request.

pub fn launch_actor_on_host(
    &self,
    actor_id: &str,
    host_id: &str
) -> Result<LaunchAck, Box<dyn Error>>
[src]

After collecting the results of a launch auction, a "winner" from among the hosts can be selected and told to launch a given actor. Note that the actor's bytes will be retrieved from the OCI registry. This function does not confirm successful launch, only that the target host acknowledged the request to launch.

pub fn stop_actor_on_host(
    &self,
    actor_id: &str,
    host_id: &str
) -> Result<(), Box<dyn Error>>
[src]

Sends a command to the specified host telling it to terminate an actor. The success of this command indicates a successful publication, and not necessarily a successful remote actor termination. Monitor the lattice events to see if the actor was successfully terminated

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>,