pub struct Client<TP: TokenProvider> { /* private fields */ }Expand description
A thin HTTP client wrapper configured for LinkedIn’s API.
Implementations§
Source§impl<TP: TokenProvider> Client<TP>
impl<TP: TokenProvider> Client<TP>
Sourcepub fn new(token_provider: TP) -> Result<Self, Error>
pub fn new(token_provider: TP) -> Result<Self, Error>
Constructs a new client using the provided token provider.
Sourcepub fn bearer(&self) -> Result<String, Error>
pub fn bearer(&self) -> Result<String, Error>
Retrieve the current bearer token from the provider.
Sourcepub fn http(&self) -> &HttpClient
pub fn http(&self) -> &HttpClient
The underlying reqwest client.
Sourcepub fn user_agent(&self) -> &str
pub fn user_agent(&self) -> &str
The default User-Agent used in requests.
Auto Trait Implementations§
impl<TP> Freeze for Client<TP>where
TP: Freeze,
impl<TP> !RefUnwindSafe for Client<TP>
impl<TP> Send for Client<TP>
impl<TP> Sync for Client<TP>
impl<TP> Unpin for Client<TP>where
TP: Unpin,
impl<TP> UnsafeUnpin for Client<TP>where
TP: UnsafeUnpin,
impl<TP> !UnwindSafe for Client<TP>
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