#[non_exhaustive]pub struct AccountInfo {
pub name: AccountName,
pub is_personal: bool,
pub is_read_only: bool,
pub account_capabilities: HashMap<String, Value>,
pub extra: Map<String, Value>,
}Expand description
Per-account metadata in a JMAP Session (RFC 8620 §2).
Debug is hand-written to redact name because the field’s own
definition identifies it as “typically the owner’s email address”
(PII under GDPR/CCPA). The other fields are non-credential metadata
and are surfaced directly. See bd:JMAP-sc1b.104.
§extra equality is feature-flag-dependent (bd:JMAP-6r7c.43)
The derived PartialEq / Eq impl’s behaviour on the extra field
depends on the global serde_json/preserve_order feature flag — see
the crate-level note
for the canonical statement.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: AccountNameHuman-readable account name (e.g. the owner’s email address).
§⚠ PII — same handling rules as Session::username (bd:JMAP-6r7c.35, bd:JMAP-6r7c.63)
Typed as AccountName (PII wrapper) so Display, Debug,
format!, and tracing::* paths all redact to "[REDACTED]"
rather than leaking the raw value. The only paths that surface
the raw string are AccountName::expose_unredacted (explicit
caller intent) and serde_json::to_string(&account)? (wire
round-trip).
See Session::username for the full PII discussion and
recommended non-PII replacement identifiers.
is_personal: booltrue if this is the authenticated user’s own personal account.
is_read_only: booltrue if the entire account is read-only for the current user.
account_capabilities: HashMap<String, Value>Map of capability URI → capability object for this account.
Values are kept as raw JSON so extension crates can extract their own capability objects.
extra: Map<String, Value>Catch-all for vendor / site / private extension fields not covered by the typed fields above. Preserves unknown fields across deserialize/serialize round-trip per workspace extras-preservation policy (see workspace AGENTS.md).
Implementations§
Source§impl AccountInfo
impl AccountInfo
Sourcepub fn account_extension_capability<T>(
&self,
capability_uri: &str,
) -> Result<Option<T>, ClientError>where
T: DeserializeOwned,
pub fn account_extension_capability<T>(
&self,
capability_uri: &str,
) -> Result<Option<T>, ClientError>where
T: DeserializeOwned,
Returns the parsed per-account extension-capability object for
capability_uri, deserialized into the caller-supplied type T
(bd:JMAP-6r7c.22).
Per-account counterpart of Session::extension_capability. Used
when an extension defines an account-scoped capability shape (e.g.
per-account quotas, per-account folder roots) rather than a
server-wide one.
§Returns
Ok(None)— this account does not advertise this capability.Ok(Some(_))— capability is advertised AND the value parsed intoT.Err(ClientError::Parse)— capability is advertised but the value could not be deserialised intoT.
Trait Implementations§
Source§impl Clone for AccountInfo
impl Clone for AccountInfo
Source§fn clone(&self) -> AccountInfo
fn clone(&self) -> AccountInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AccountInfo
Manual Debug impl that redacts name (bd:JMAP-sc1b.104).
impl Debug for AccountInfo
Manual Debug impl that redacts name (bd:JMAP-sc1b.104).
AccountInfo.name is typically the owner’s email address, which is
PII under GDPR/CCPA. The other fields (is_personal, is_read_only,
account_capabilities) are non-credential metadata and are surfaced
directly so {:?} output remains useful for debugging.
This redaction closes the transitive leak through Session.accounts
— Session’s own Debug impl (bd:JMAP-sc1b.99) only redacted
username and state directly and was silent about the accounts
map. With AccountInfo redacting itself, any {:?} of a Session
is now safe with respect to the canonical email-shaped PII.
Source§impl<'de> Deserialize<'de> for AccountInfo
impl<'de> Deserialize<'de> for AccountInfo
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 AccountInfo
Source§impl PartialEq for AccountInfo
impl PartialEq for AccountInfo
Source§fn eq(&self, other: &AccountInfo) -> bool
fn eq(&self, other: &AccountInfo) -> bool
self and other values to be equal, and is used by ==.