pub struct CliSession {Show 13 fields
pub version: u32,
pub tenant_key: Option<TenantId>,
pub profile_name: ProfileName,
pub profile_path: Option<PathBuf>,
pub session_token: SessionToken,
pub session_id: SessionId,
pub context_id: ContextId,
pub user_id: UserId,
pub user_email: Email,
pub user_type: UserType,
pub created_at: DateTime<Utc>,
pub expires_at: DateTime<Utc>,
pub last_used: DateTime<Utc>,
}Fields§
§version: u32§tenant_key: Option<TenantId>§profile_name: ProfileName§profile_path: Option<PathBuf>§session_token: SessionToken§session_id: SessionId§context_id: ContextId§user_id: UserId§user_email: Email§user_type: UserType§created_at: DateTime<Utc>§expires_at: DateTime<Utc>§last_used: DateTime<Utc>Implementations§
Source§impl CliSession
impl CliSession
pub fn builder( profile_name: ProfileName, session_token: SessionToken, session_id: SessionId, context_id: ContextId, ) -> CliSessionBuilder
pub fn context_id(&self) -> &ContextId
pub fn touch(&mut self)
pub fn set_context_id(&mut self, context_id: ContextId)
pub fn is_expired(&self) -> bool
pub fn is_valid_for_profile(&self, profile_name: &str) -> bool
pub fn has_valid_credentials(&self) -> bool
pub fn is_valid_for_tenant(&self, key: &SessionKey) -> bool
pub fn session_key(&self) -> SessionKey
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 CliSession
impl Clone for CliSession
Source§fn clone(&self) -> CliSession
fn clone(&self) -> CliSession
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 CliSession
impl Debug for CliSession
Source§impl<'de> Deserialize<'de> for CliSession
impl<'de> Deserialize<'de> for CliSession
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
Auto Trait Implementations§
impl Freeze for CliSession
impl RefUnwindSafe for CliSession
impl Send for CliSession
impl Sync for CliSession
impl Unpin for CliSession
impl UnwindSafe for CliSession
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