pub struct CredentialProfiles { /* private fields */ }
Expand description
A struct representing the remote.it credentials file.
The credentials file can have multiple profiles, each with its own access key ID and secret access key.
The secret access keys of the profiles within this struct are base64 encoded.
At this point they are unverified, which is why the inner HashMap
is private.
The secret key of the profile you want will be verified, when the profile is retrieved using one of:
CredentialProfiles::take_profile
- [
CredentialProfiles::profile
]
Implementations§
Source§impl CredentialProfiles
impl CredentialProfiles
Sourcepub fn take_profile(
&mut self,
profile_name: &str,
) -> Result<Option<Credentials>, DecodeError>
pub fn take_profile( &mut self, profile_name: &str, ) -> Result<Option<Credentials>, DecodeError>
Takes the profile with the given name out of the inner HashMap
, validated the secret access key and returns it.
You can only take a profile once, after that it is removed from the inner HashMap
.
§Returns
None
if the profile with the given name does not exist.Some
containing theCredentials
with the given name, if the profile exists.
§Errors
base64::DecodeError
if the secret access key of the profile with the given name is not base64 encoded.
Trait Implementations§
Source§impl Clone for CredentialProfiles
impl Clone for CredentialProfiles
Source§fn clone(&self) -> CredentialProfiles
fn clone(&self) -> CredentialProfiles
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for CredentialProfiles
impl Debug for CredentialProfiles
Source§impl<'de> Deserialize<'de> for CredentialProfiles
impl<'de> Deserialize<'de> for CredentialProfiles
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for CredentialProfiles
impl PartialEq for CredentialProfiles
Source§impl Serialize for CredentialProfiles
impl Serialize for CredentialProfiles
impl Eq for CredentialProfiles
impl StructuralPartialEq for CredentialProfiles
Auto Trait Implementations§
impl Freeze for CredentialProfiles
impl RefUnwindSafe for CredentialProfiles
impl Send for CredentialProfiles
impl Sync for CredentialProfiles
impl Unpin for CredentialProfiles
impl UnwindSafe for CredentialProfiles
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.