pub struct ProviderDefinition {
pub descriptor: ProviderDescriptor,
pub wire_api: WireApi,
pub auth_scheme: AuthScheme,
pub capabilities: ProviderCapabilities,
pub base_url: Option<String>,
pub query_params: Option<HashMap<String, String>>,
pub headers: Option<HashMap<String, String>>,
pub retry: RetryPolicy,
pub stream_idle_timeout: Duration,
pub websocket_connect_timeout: Duration,
}Expand description
Serializable provider definition used by runtime and adapter layers.
Fields§
§descriptor: ProviderDescriptor§wire_api: WireApi§auth_scheme: AuthScheme§capabilities: ProviderCapabilities§base_url: Option<String>§query_params: Option<HashMap<String, String>>§headers: Option<HashMap<String, String>>§retry: RetryPolicy§stream_idle_timeout: Duration§websocket_connect_timeout: DurationImplementations§
Source§impl ProviderDefinition
impl ProviderDefinition
pub fn new(id: impl Into<ProviderId>) -> ProviderDefinition
pub fn descriptor(&self) -> ProviderDescriptor
pub fn provider_id(&self) -> &ProviderId
pub fn url_for_path(&self, path: &str) -> String
pub fn build_headers( &self, credentials: &ProviderCredentials, ) -> Result<HeaderMap, ProviderError>
pub fn build_headers_for_session( &self, credentials: &ProviderCredentials, session: Option<&SessionRequestOptions>, fallback_turn_state: Option<&str>, ) -> Result<HeaderMap, ProviderError>
pub fn request_url_with_auth_for_path( &self, path: &str, credentials: &ProviderCredentials, ) -> Result<Url, ProviderError>
pub fn websocket_url_for_path(&self, path: &str) -> Result<Url, ParseError>
pub fn websocket_url_with_auth_for_path( &self, path: &str, credentials: &ProviderCredentials, ) -> Result<Url, ProviderError>
Trait Implementations§
Source§impl Clone for ProviderDefinition
impl Clone for ProviderDefinition
Source§fn clone(&self) -> ProviderDefinition
fn clone(&self) -> ProviderDefinition
Returns a duplicate of the value. Read more
1.0.0 · 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 ProviderDefinition
impl Debug for ProviderDefinition
Source§impl<'de> Deserialize<'de> for ProviderDefinition
impl<'de> Deserialize<'de> for ProviderDefinition
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ProviderDefinition, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ProviderDefinition, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ProviderDefinition
impl PartialEq for ProviderDefinition
Source§impl Serialize for ProviderDefinition
impl Serialize for ProviderDefinition
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for ProviderDefinition
impl StructuralPartialEq for ProviderDefinition
Auto Trait Implementations§
impl Freeze for ProviderDefinition
impl RefUnwindSafe for ProviderDefinition
impl Send for ProviderDefinition
impl Sync for ProviderDefinition
impl Unpin for ProviderDefinition
impl UnsafeUnpin for ProviderDefinition
impl UnwindSafe for ProviderDefinition
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.