pub struct ProviderDescriptor {
pub kind: ProviderKind,
pub inner: &'static dyn Provider,
}Expand description
Route-facing view of a built-in provider’s transport facts.
Holds a trait object, so it is deliberately not serializable/comparable.
Fields§
§kind: ProviderKindThe provider kind this descriptor describes.
inner: &'static dyn ProviderBacking static provider metadata entry.
Implementations§
Source§impl ProviderDescriptor
impl ProviderDescriptor
Sourcepub fn for_kind(kind: ProviderKind) -> Self
pub fn for_kind(kind: ProviderKind) -> Self
Build a descriptor for a known provider kind.
Sourcepub fn id(&self) -> ProviderId
pub fn id(&self) -> ProviderId
Canonical provider id.
Sourcepub fn default_base_url(&self) -> &'static str
pub fn default_base_url(&self) -> &'static str
Default base URL when no override is present.
Sourcepub fn default_wire_model(&self) -> WireModelId
pub fn default_wire_model(&self) -> WireModelId
Default wire model id when no model is selected.
Sourcepub fn env_vars(&self) -> &'static [&'static str]
pub fn env_vars(&self) -> &'static [&'static str]
Environment variable candidates for this provider’s API key.
Sourcepub fn wire_policy(&self) -> WirePolicy
pub fn wire_policy(&self) -> WirePolicy
Policy used to select this provider’s wire protocol.
Sourcepub fn protocol_for_endpoint(
&self,
endpoint_key: &str,
) -> Option<RequestProtocol>
pub fn protocol_for_endpoint( &self, endpoint_key: &str, ) -> Option<RequestProtocol>
Resolve the concrete protocol for an offering endpoint key.
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 moreimpl Copy for ProviderDescriptor
Auto Trait Implementations§
impl !RefUnwindSafe for ProviderDescriptor
impl !UnwindSafe for ProviderDescriptor
impl Freeze for ProviderDescriptor
impl Send for ProviderDescriptor
impl Sync for ProviderDescriptor
impl Unpin for ProviderDescriptor
impl UnsafeUnpin 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