pub enum EventHubTokenCredential {
SharedAccessCredential(SharedAccessCredential),
Other(Box<dyn TokenCredential>),
}Expand description
Provides a generic token-based credential for a given Event Hub instance.
This supports SharedAccessCredential and any other credential type that implements
TokenCredential, eg. [azure_identity::DefaultAzureCredential].
§Example
use azure_identity::{DefaultAzureCredential, TokenCredentialOptions};
use azeventhubs::authorization::EventHubTokenCredential;
let default_credential = DefaultAzureCredential::create(TokenCredentialOptions::default()).unwrap();
let credential = EventHubTokenCredential::from(default_credential);Variants§
Implementations§
Source§impl EventHubTokenCredential
impl EventHubTokenCredential
Sourcepub fn new(source: impl Into<Self>) -> Self
pub fn new(source: impl Into<Self>) -> Self
Creates a new instance of EventHubTokenCredential. This is simply an alias for
From::from
Indicates whether the credential is based on an Event Hubs shared access policy.
Trait Implementations§
Source§impl Debug for EventHubTokenCredential
impl Debug for EventHubTokenCredential
Source§fn from(source: SharedAccessCredential) -> Self
fn from(source: SharedAccessCredential) -> Self
Converts to this type from the input type.
Source§impl<TC> From<TC> for EventHubTokenCredentialwhere
TC: TokenCredential + 'static,
impl<TC> From<TC> for EventHubTokenCredentialwhere
TC: TokenCredential + 'static,
Auto Trait Implementations§
impl !Freeze for EventHubTokenCredential
impl !RefUnwindSafe for EventHubTokenCredential
impl Send for EventHubTokenCredential
impl Sync for EventHubTokenCredential
impl Unpin for EventHubTokenCredential
impl !UnwindSafe for EventHubTokenCredential
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