pub struct Client { /* private fields */ }Expand description
TEA consumer client.
Cloning shares the connection pool, token cache, and limits.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new() -> Result<Self, ClientError>
pub fn new() -> Result<Self, ClientError>
Production client for TEA 1.0.0.
§Errors
Returns an error when the HTTP client cannot be constructed.
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Start a builder.
Source§impl Client
impl Client
Sourcepub async fn discover(
&self,
tei: &Tei,
) -> Result<Vec<ResolvedRelease>, ClientError>
pub async fn discover( &self, tei: &Tei, ) -> Result<Vec<ResolvedRelease>, ClientError>
Resolve a TEI through .well-known/tea and /discovery.
A TEA 404 from /discovery stops the search and returns
ClientError::Unresolved. It is not treated as a missing route and
it is not evidence that no updates exist. 401 and 403 do not fail
over to another endpoint.
§Errors
Returns an error when the TEI cannot be resolved or discovery attempts are exhausted.
Sourcepub fn open(&self, release: &ResolvedRelease) -> Result<Service, ClientError>
pub fn open(&self, release: &ResolvedRelease) -> Result<Service, ClientError>
Open a service for a resolved release.
§Errors
Returns an error when the selected base URL is not allowed.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
impl Forget for Client
impl Freeze for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
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