pub struct Client { /* private fields */ }Expand description
Basic HTTP client using TLS wrapping a reqwest::Client,
with the minimum required features to call YouTube Music queries.
Clone is low cost, internals of reqwest::Client are wrapped in an Arc.
Implementations§
source§impl Client
impl Client
sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Utilises reqwest’s default tls choice for the enabled set of options.
sourcepub fn new_rustls_tls() -> Result<Self>
Available on crate feature rustls-tls only.
pub fn new_rustls_tls() -> Result<Self>
rustls-tls only.Force the use of rustls-tls
sourcepub fn new_native_tls() -> Result<Self>
Available on crate feature native-tls only.
pub fn new_native_tls() -> Result<Self>
native-tls only.Force the use of native-tls
sourcepub async fn post_query<'a, I>(
&self,
url: impl AsRef<str>,
headers: impl IntoIterator<IntoIter = I>,
body_json: &(impl Serialize + ?Sized),
) -> Result<String>
pub async fn post_query<'a, I>( &self, url: impl AsRef<str>, headers: impl IntoIterator<IntoIter = I>, body_json: &(impl Serialize + ?Sized), ) -> Result<String>
Run a POST query, with url and headers. Result is returned as a String.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)