pub struct ProviderDescriptor { /* private fields */ }Expand description
Stable provider metadata used for registration and selection.
Implementations§
Source§impl ProviderDescriptor
impl ProviderDescriptor
Sourcepub fn new(id: &str) -> Result<Self, ProviderRegistryError>
pub fn new(id: &str) -> Result<Self, ProviderRegistryError>
Creates a descriptor with no aliases and zero priority.
§Parameters
id: Provider id.
§Returns
Provider descriptor.
§Errors
Returns ProviderRegistryError when id is not a valid provider name.
Sourcepub fn with_aliases(
self,
aliases: &[&str],
) -> Result<Self, ProviderRegistryError>
pub fn with_aliases( self, aliases: &[&str], ) -> Result<Self, ProviderRegistryError>
Sets provider aliases.
§Parameters
aliases: Provider aliases.
§Returns
Updated provider descriptor.
§Errors
Returns ProviderRegistryError when any alias is not a valid provider
name, or when aliases duplicate the descriptor id or each other.
Sourcepub fn with_priority(self, priority: i32) -> Self
pub fn with_priority(self, priority: i32) -> Self
Sourcepub fn id(&self) -> &ProviderName
pub fn id(&self) -> &ProviderName
Sourcepub fn aliases(&self) -> &[ProviderName]
pub fn aliases(&self) -> &[ProviderName]
Sourcepub fn aliases_as_str(&self) -> Vec<&str>
pub fn aliases_as_str(&self) -> Vec<&str>
Trait Implementations§
Source§impl Clone for ProviderDescriptor
impl Clone for ProviderDescriptor
Source§fn clone(&self) -> ProviderDescriptor
fn clone(&self) -> ProviderDescriptor
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 ProviderDescriptor
impl Debug for ProviderDescriptor
Source§impl PartialEq for ProviderDescriptor
impl PartialEq for ProviderDescriptor
Source§fn eq(&self, other: &ProviderDescriptor) -> bool
fn eq(&self, other: &ProviderDescriptor) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for ProviderDescriptor
impl StructuralPartialEq for ProviderDescriptor
Auto Trait Implementations§
impl Freeze for ProviderDescriptor
impl RefUnwindSafe for ProviderDescriptor
impl Send for ProviderDescriptor
impl Sync for ProviderDescriptor
impl Unpin for ProviderDescriptor
impl UnsafeUnpin for ProviderDescriptor
impl UnwindSafe for ProviderDescriptor
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