pub struct Credentials {
pub username: Option<String>,
pub password: Option<String>,
pub access_key: Option<String>,
pub secret_key: Option<String>,
}Expand description
Authentication credentials
Fields§
§username: Option<String>Username for basic auth
password: Option<String>Password for basic auth
access_key: Option<String>Access key for RAM auth (Alibaba Cloud style)
secret_key: Option<String>Secret key for RAM auth
Implementations§
Source§impl Credentials
impl Credentials
Sourcepub fn with_username_password(
username: impl Into<String>,
password: impl Into<String>,
) -> Self
pub fn with_username_password( username: impl Into<String>, password: impl Into<String>, ) -> Self
Create credentials with username and password
Sourcepub fn with_access_key(
access_key: impl Into<String>,
secret_key: impl Into<String>,
) -> Self
pub fn with_access_key( access_key: impl Into<String>, secret_key: impl Into<String>, ) -> Self
Create credentials with access key and secret key
Sourcepub fn is_configured(&self) -> bool
pub fn is_configured(&self) -> bool
Check if credentials are configured
Sourcepub fn has_basic_auth(&self) -> bool
pub fn has_basic_auth(&self) -> bool
Check if basic auth is configured
Sourcepub fn has_ak_sk_auth(&self) -> bool
pub fn has_ak_sk_auth(&self) -> bool
Check if AK/SK auth is configured
Sourcepub fn generate_signature(&self, resource: &str) -> Option<SignatureInfo>
pub fn generate_signature(&self, resource: &str) -> Option<SignatureInfo>
Generate signature for AK/SK auth
Trait Implementations§
Source§impl Clone for Credentials
impl Clone for Credentials
Source§fn clone(&self) -> Credentials
fn clone(&self) -> Credentials
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Credentials
impl Debug for Credentials
Source§impl Default for Credentials
impl Default for Credentials
Source§fn default() -> Credentials
fn default() -> Credentials
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Credentials
impl RefUnwindSafe for Credentials
impl Send for Credentials
impl Sync for Credentials
impl Unpin for Credentials
impl UnwindSafe for Credentials
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request