pub struct Account {
pub email: String,
pub tenant_id: String,
pub home_account_id: String,
pub added_at: DateTime<Utc>,
pub storage: TokenStorage,
}Expand description
A signed-in Microsoft account.
This is metadata only — no tokens. Tokens live in the OS keychain
or in a per-account file at ~/.config/pidge/tokens/<email>.json,
keyed by email. The storage field tells pidge which backend to look in.
Fields§
§email: String§tenant_id: String§home_account_id: String§added_at: DateTime<Utc>§storage: TokenStorageImplementations§
Source§impl Account
impl Account
Sourcepub const PERSONAL_MSA_TENANT: &'static str = "9188040d-6c67-4c5b-b112-36a304b66dad"
pub const PERSONAL_MSA_TENANT: &'static str = "9188040d-6c67-4c5b-b112-36a304b66dad"
Well-known tenant ID for personal Microsoft accounts (outlook.com, live.com, hotmail.com). Microsoft documents this as the “MSA” tenant.
Sourcepub fn is_personal(&self) -> bool
pub fn is_personal(&self) -> bool
True if this account is a personal Microsoft account.
Sourcepub fn tenant_label(&self) -> String
pub fn tenant_label(&self) -> String
A short human label for the tenant — “personal MSA” for MSA, GUID prefix
otherwise. Returns “(unknown)” when the tenant_id is empty (e.g. an
account added before pidge requested the openid scope; gets
auto-backfilled on the next Graph call).
Sourcepub fn provider_label(&self) -> &'static str
pub fn provider_label(&self) -> &'static str
Short human-readable label for the account’s provider / kind. Today we only support Microsoft, so this distinguishes personal MSA (Outlook / Live / Hotmail) from organizational M365 tenants. As we add Gmail, IMAP, etc., this becomes a stored field rather than a derived one.
Sourcepub fn provider_id(&self) -> &'static str
pub fn provider_id(&self) -> &'static str
Machine-readable provider identifier — used in --json output and any
future config-file lookups. Stays stable as labels change.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Account
impl<'de> Deserialize<'de> for Account
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>,
impl Eq for Account
impl StructuralPartialEq for Account
Auto Trait Implementations§
impl Freeze for Account
impl RefUnwindSafe for Account
impl Send for Account
impl Sync for Account
impl Unpin for Account
impl UnsafeUnpin for Account
impl UnwindSafe for Account
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
key and return true if they are equal.