Skip to main content

Provider

Trait Provider 

Source
pub trait Provider {
    // Required methods
    fn name(&self) -> &str;
    fn short_label(&self) -> &str;
    fn fetch_hosts(
        &self,
        token: &str,
    ) -> Result<Vec<ProviderHost>, ProviderError>;

    // Provided method
    fn fetch_hosts_cancellable(
        &self,
        token: &str,
        cancel: &AtomicBool,
    ) -> Result<Vec<ProviderHost>, ProviderError> { ... }
}
Expand description

Trait implemented by each cloud provider.

Required Methods§

Source

fn name(&self) -> &str

Full provider name (e.g. “digitalocean”).

Source

fn short_label(&self) -> &str

Short label for aliases (e.g. “do”).

Source

fn fetch_hosts(&self, token: &str) -> Result<Vec<ProviderHost>, ProviderError>

Fetch all servers from the provider API.

Provided Methods§

Source

fn fetch_hosts_cancellable( &self, token: &str, cancel: &AtomicBool, ) -> Result<Vec<ProviderHost>, ProviderError>

Fetch hosts with cancellation support. Default delegates to fetch_hosts.

Implementors§