pub struct KeyTokenProvider { /* private fields */ }Expand description
Mints Ably Tokens by calling POST /keys/{keyName}/requestToken with an
unsigned TokenParams body under HTTP Basic auth. Pair with
Auth::provider for automatic use + refresh.
Implementations§
Source§impl KeyTokenProvider
impl KeyTokenProvider
Sourcepub fn new(api_key: impl AsRef<str>) -> Result<Self>
pub fn new(api_key: impl AsRef<str>) -> Result<Self>
New provider from a full API key appId.keyId:keySecret.
Sourcepub fn capability(self, cap: impl Into<String>) -> Self
pub fn capability(self, cap: impl Into<String>) -> Self
Restrict issued tokens to this capability (a JSON string; with the
capabilities feature, build it via Capability::to_capability_string).
Sourcepub fn host(self, host: impl Into<String>) -> Self
pub fn host(self, host: impl Into<String>) -> Self
Override the platform host (defaults to https://rest.ably.io).
Sourcepub fn http_client(self, client: Client) -> Self
pub fn http_client(self, client: Client) -> Self
Supply a preconfigured reqwest::Client.
Trait Implementations§
Source§impl Clone for KeyTokenProvider
impl Clone for KeyTokenProvider
Source§fn clone(&self) -> KeyTokenProvider
fn clone(&self) -> KeyTokenProvider
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KeyTokenProvider
impl Debug for KeyTokenProvider
Source§impl TokenProvider for KeyTokenProvider
impl TokenProvider for KeyTokenProvider
Auto Trait Implementations§
impl !RefUnwindSafe for KeyTokenProvider
impl !UnwindSafe for KeyTokenProvider
impl Freeze for KeyTokenProvider
impl Send for KeyTokenProvider
impl Sync for KeyTokenProvider
impl Unpin for KeyTokenProvider
impl UnsafeUnpin for KeyTokenProvider
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