pub trait Provider {
// Required methods
fn name(&self) -> &str;
fn short_label(&self) -> &str;
fn fetch_hosts_cancellable(
&self,
token: &str,
cancel: &AtomicBool,
) -> Result<Vec<ProviderHost>, ProviderError>;
// Provided methods
fn fetch_hosts(
&self,
token: &str,
) -> Result<Vec<ProviderHost>, ProviderError> { ... }
fn fetch_hosts_with_progress(
&self,
token: &str,
cancel: &AtomicBool,
_progress: &dyn Fn(&str),
) -> Result<Vec<ProviderHost>, ProviderError> { ... }
}Expand description
Trait implemented by each cloud provider.
Required Methods§
Sourcefn short_label(&self) -> &str
fn short_label(&self) -> &str
Short label for aliases (e.g. “do”).
Sourcefn fetch_hosts_cancellable(
&self,
token: &str,
cancel: &AtomicBool,
) -> Result<Vec<ProviderHost>, ProviderError>
fn fetch_hosts_cancellable( &self, token: &str, cancel: &AtomicBool, ) -> Result<Vec<ProviderHost>, ProviderError>
Fetch hosts with cancellation support.
Provided Methods§
Sourcefn fetch_hosts(&self, token: &str) -> Result<Vec<ProviderHost>, ProviderError>
fn fetch_hosts(&self, token: &str) -> Result<Vec<ProviderHost>, ProviderError>
Fetch all servers from the provider API.
Sourcefn fetch_hosts_with_progress(
&self,
token: &str,
cancel: &AtomicBool,
_progress: &dyn Fn(&str),
) -> Result<Vec<ProviderHost>, ProviderError>
fn fetch_hosts_with_progress( &self, token: &str, cancel: &AtomicBool, _progress: &dyn Fn(&str), ) -> Result<Vec<ProviderHost>, ProviderError>
Fetch hosts with progress reporting. Default delegates to fetch_hosts_cancellable.