pub struct CloudCredentials {
pub api_token: String,
pub api_url: String,
pub authenticated_at: DateTime<Utc>,
pub user_email: Option<String>,
}Fields§
§api_token: String§api_url: String§authenticated_at: DateTime<Utc>§user_email: Option<String>Implementations§
Source§impl CloudCredentials
impl CloudCredentials
pub fn new( api_token: String, api_url: String, user_email: Option<String>, ) -> Self
pub fn token(&self) -> CloudAuthToken
pub fn is_token_expired(&self) -> bool
pub fn expires_within(&self, duration: Duration) -> bool
pub fn load_and_validate_from_path(path: &Path) -> Result<Self>
pub async fn validate_with_api(&self) -> Result<bool>
pub fn load_from_path(path: &Path) -> Result<Self>
pub fn save_to_path(&self, path: &Path) -> Result<()>
pub fn delete_from_path(path: &Path) -> Result<()>
Trait Implementations§
Source§impl Clone for CloudCredentials
impl Clone for CloudCredentials
Source§fn clone(&self) -> CloudCredentials
fn clone(&self) -> CloudCredentials
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 CloudCredentials
impl Debug for CloudCredentials
Source§impl<'de> Deserialize<'de> for CloudCredentials
impl<'de> Deserialize<'de> for CloudCredentials
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 Serialize for CloudCredentials
impl Serialize for CloudCredentials
Source§impl Validate for CloudCredentials
impl Validate for CloudCredentials
Source§impl<'v_a> ValidateArgs<'v_a> for CloudCredentials
impl<'v_a> ValidateArgs<'v_a> for CloudCredentials
Auto Trait Implementations§
impl Freeze for CloudCredentials
impl RefUnwindSafe for CloudCredentials
impl Send for CloudCredentials
impl Sync for CloudCredentials
impl Unpin for CloudCredentials
impl UnwindSafe for CloudCredentials
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<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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more