pub struct Client<F: Fetcher = MemoryFetcher> { /* private fields */ }Expand description
A client bound to a registry base URL and a Fetcher.
Construct with Client::new (default fetcher is a MemoryFetcher,
intended for tests — production code supplies a real HTTP fetcher).
Implementations§
Source§impl Client<MemoryFetcher>
impl Client<MemoryFetcher>
Sourcepub fn new(base_url: impl Into<String>) -> Self
pub fn new(base_url: impl Into<String>) -> Self
Build a client backed by a MemoryFetcher. Production code
should use Client::with_fetcher to plug in a network-capable
transport.
Source§impl<F: Fetcher> Client<F>
impl<F: Fetcher> Client<F>
Sourcepub fn with_fetcher(base_url: impl Into<String>, fetcher: F) -> Self
pub fn with_fetcher(base_url: impl Into<String>, fetcher: F) -> Self
Build a client with a custom fetcher.
Sourcepub fn index(&self) -> Result<RegistryIndex>
pub fn index(&self) -> Result<RegistryIndex>
Fetch the master catalog.
Sourcepub fn trust_roots(&self) -> Result<TrustRootsFile>
pub fn trust_roots(&self) -> Result<TrustRootsFile>
Fetch the default trust roots file.
Sourcepub fn plugin_index(&self, versions_url: &str) -> Result<PluginIndex>
pub fn plugin_index(&self, versions_url: &str) -> Result<PluginIndex>
Fetch a per-plugin version index.
versions_url is the registry-relative path from the master
index entry (e.g. /plugins/botan/index.toml).
Auto Trait Implementations§
impl<F> Freeze for Client<F>where
F: Freeze,
impl<F> RefUnwindSafe for Client<F>where
F: RefUnwindSafe,
impl<F> Send for Client<F>where
F: Send,
impl<F> Sync for Client<F>where
F: Sync,
impl<F> Unpin for Client<F>where
F: Unpin,
impl<F> UnsafeUnpin for Client<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for Client<F>where
F: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more