pub struct CustomProfile {
pub name: String,
pub base_url: String,
pub auth_scheme: AuthScheme,
pub capabilities: CapabilitySet,
}Expand description
表示自定义 Provider 实现。
Fields§
§name: StringProvider 的自定义名称。
base_url: String默认基础地址。
auth_scheme: AuthScheme认证方案。
capabilities: CapabilitySet能力集合。
Trait Implementations§
Source§impl Clone for CustomProfile
impl Clone for CustomProfile
Source§fn clone(&self) -> CustomProfile
fn clone(&self) -> CustomProfile
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 CustomProfile
impl Debug for CustomProfile
Source§impl ProviderProfile for CustomProfile
impl ProviderProfile for CustomProfile
Source§fn kind(&self) -> ProviderKind
fn kind(&self) -> ProviderKind
返回 Provider 类型。
Source§fn default_base_url(&self) -> &str
fn default_base_url(&self) -> &str
返回默认基础地址。
Source§fn auth_scheme(&self) -> AuthScheme
fn auth_scheme(&self) -> AuthScheme
返回认证方案。
Source§fn capabilities(&self) -> &'static CapabilitySet
fn capabilities(&self) -> &'static CapabilitySet
返回能力集合。
Source§fn prepare_request(&self, _ctx: &mut RequestContext) -> Result<()>
fn prepare_request(&self, _ctx: &mut RequestContext) -> Result<()>
在请求真正构建前对请求做进一步调整。
Source§fn validate_request(
&self,
_endpoint_id: &'static str,
_body: Option<&Value>,
_mode: CompatibilityMode,
) -> Result<()>
fn validate_request( &self, _endpoint_id: &'static str, _body: Option<&Value>, _mode: CompatibilityMode, ) -> Result<()>
在发送前校验请求是否符合当前 Provider 要求。
Source§fn adapt_error(&self, error: ApiError) -> Error
fn adapt_error(&self, error: ApiError) -> Error
根据 Provider 规则适配错误。
Auto Trait Implementations§
impl Freeze for CustomProfile
impl RefUnwindSafe for CustomProfile
impl Send for CustomProfile
impl Sync for CustomProfile
impl Unpin for CustomProfile
impl UnsafeUnpin for CustomProfile
impl UnwindSafe for CustomProfile
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