pub trait RemoteSource:
Send
+ Sync
+ 'static {
// Required methods
fn fetch(&self) -> Result<Fetched, Error>;
fn describe(&self) -> String;
}Expand description
A remote store that can be read without an async runtime.
The right trait for anything with a plain HTTP API — Consul and Vault both
are — because implementing it needs no runtime and using it needs no
runtime either. fetch may block; it is called from
refresh_remote(), never from load().
Required Methods§
Sourcefn fetch(&self) -> Result<Fetched, Error>
fn fetch(&self) -> Result<Fetched, Error>
Reads the current document.
§Errors
Whatever going wrong looks like for this store. Use
Error::remote so the failure is categorised
consistently, or Error::auth for a credential
the store itself refused — that is the distinction a watch loop backs
off on rather than stopping.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".