Skip to main content

Client

Struct Client 

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

Source

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>

Source

pub fn with_fetcher(base_url: impl Into<String>, fetcher: F) -> Self

Build a client with a custom fetcher.

Source

pub fn base_url(&self) -> &str

Borrow the base URL.

Source

pub fn index(&self) -> Result<RegistryIndex>

Fetch the master catalog.

Source

pub fn trust_roots(&self) -> Result<TrustRootsFile>

Fetch the default trust roots file.

Source

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).

Source

pub fn manifest(&self, manifest_url: &str) -> Result<Manifest>

Fetch a per-version manifest.

Source

pub fn resolve(&self, name: &str, version: Option<&str>) -> Result<Manifest>

Resolve a (name, version) to a manifest.

When version is None, the per-plugin latest pointer is used.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.