pub enum ServiceBusTokenCredential {
SharedAccessCredential(SharedAccessCredential),
Other(Arc<dyn TokenCredential>),
}Expand description
Token-based credential for Service Bus.
This supports SharedAccessCredential and other credential types that
implement TokenCredential (eg. azure_identity::DefaultAzureCredential).
§Example
use azure_identity::DefaultAzureCredential;
use azservicebus::authorization::ServiceBusTokenCredential;
let default_credential = DefaultAzureCredential::new().unwrap();
let credential = ServiceBusTokenCredential::from(default_credential);Variants§
Shared Access Signature credential.
FIXME: This is a temporary workaround until specialization is stablized.
Other(Arc<dyn TokenCredential>)
Other credential types.
TODO: Is the use of trait object here justified?
Implementations§
Source§impl ServiceBusTokenCredential
impl ServiceBusTokenCredential
Sourcepub fn new(source: Arc<dyn TokenCredential>) -> Self
pub fn new(source: Arc<dyn TokenCredential>) -> Self
Creates a new ServiceBusTokenCredential from the given credential. This is an alias for
From::from.
Indicates whether the credential is based on an Service Bus shared access policy.
Trait Implementations§
Source§impl Debug for ServiceBusTokenCredential
impl Debug for ServiceBusTokenCredential
Source§impl<TC> From<Arc<TC>> for ServiceBusTokenCredentialwhere
TC: TokenCredential + 'static,
impl<TC> From<Arc<TC>> for ServiceBusTokenCredentialwhere
TC: TokenCredential + 'static,
Source§fn from(source: SharedAccessCredential) -> Self
fn from(source: SharedAccessCredential) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !Freeze for ServiceBusTokenCredential
impl !RefUnwindSafe for ServiceBusTokenCredential
impl Send for ServiceBusTokenCredential
impl Sync for ServiceBusTokenCredential
impl Unpin for ServiceBusTokenCredential
impl !UnwindSafe for ServiceBusTokenCredential
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