Skip to main content

Crate pidge_core

Crate pidge_core 

Source
Expand description

Core types for pidge: accounts, configuration, and the normalized message model.

This crate is intentionally provider-agnostic — it knows nothing about HTTP, Microsoft Graph, or authentication. Those concerns live in pidge-client.

Structs§

Account
A signed-in Microsoft account.
Attachment
An attachment listed on a message. Bytes are NOT included — fetch separately via GraphClient::get_attachment_bytes(account, message_id, attachment.id).
Attendee
CachedEventRef
Cached pointer to a Microsoft Graph event. Keyed in the cache by short_hash("{account}|{event_id}") so the same event ID under different signed-in accounts gets distinct hashes.
CachedMessageRef
Calendar
Config
Contact
One person known to pidge — collapsed from one or more mail / calendar observations of the same lowercase email address.
ContactsCache
JSON-backed contact cache. Keyed by lowercase email.
Defaults
Event
EventCache
EventTime
A calendar instant. at is the canonical UTC time; tz is the IANA zone the event was scheduled in (e.g. "Europe/Stockholm"). Display layers honour tz so a Stockholm-scheduled meeting still says “10:00 Stockholm” when read from a laptop in Sydney.
FullMessage
Full message content as returned by GraphClient::get_message. Compared to Message (the list-row shape), this carries full body, all recipient lists, sent/received timestamps, and a has_attachments flag for triggering the attachment fetch.
Message
One message in a mailbox, as presented to commands and output formatters.
MessageCache
MessageFrom
RecurrencePattern

Enums§

AttendeeKind
BodyContentType
CacheLookup
Result of looking up a fragment against the cache.
ContactSource
Where a contact observation came from. Determines which seen_in_* counter gets incremented.
CoreError
FlagStatus
Outlook’s follow-up flag state on a message. Three values to match what Graph returns; the CLI currently only sets Flagged / NotFlagged, but it reads and displays all three so a flag a user completed in Outlook shows up correctly here.
RecurrenceFreq
RecurrenceRange
ResponseStatus
TokenStorage
Where pidge stores OAuth tokens for an account.
Weekday

Functions§

short_hash
Compute the 8-char hex short hash for a Graph ID. Deterministic: same input -> same output. Stable across pidge runs and machines.