pub struct Client { /* private fields */ }Expand description
A blocking handle to one SIE server.
Cloning shares the runtime and the connection pool.
Implementations§
Source§impl Client
impl Client
Sourcepub fn builder(base_url: impl AsRef<str>) -> ClientBuilder
pub fn builder(base_url: impl AsRef<str>) -> ClientBuilder
Start configuring a blocking client.
Sourcepub fn call<'a, F, Fut, T>(&'a self, request: F) -> Result<T>
pub fn call<'a, F, Fut, T>(&'a self, request: F) -> Result<T>
Build a request from the async client and run it to completion.
The closure’s borrow is tied to this client, so a request that borrows it (the namespace accessors do) is as easy to write as one that owns its state.
Sourcepub fn block_on<Fut: Future>(&self, future: Fut) -> Fut::Output
pub fn block_on<Fut: Future>(&self, future: Fut) -> Fut::Output
Run any future on this client’s runtime.
Useful for futures that are not a single request, such as joining several calls.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl !UnwindSafe 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