pub enum Address {
Direct {
participant: ParticipantId,
},
Session {
participant: ParticipantId,
session: SessionId,
},
Room {
room: RoomId,
},
}Expand description
Where a message goes, or who it is from: one account directly, one of
that account’s live sessions, or a room the mailbox tracks membership
for. Serde-tagged on kind ("direct" / "session" / "room").
Replaces the source’s HarnessMailAddressV1::Session/Task: a room is
a named group of participants the mailbox itself tracks, with no
relationship to any task system – unlike Task, which addressed every
grant able to read a given task_id in a foreign task kernel this crate
must never learn about. Self::Session is this crate’s own addition
(mailbox-service-extraction-and-signed-session-identity-2026-09-16.md
§5e): a session is a participant, not a new concept beside one, so it
is a third shape of the same address type rather than a parallel id.
Variants§
Implementations§
Source§impl Address
impl Address
pub fn validate(&self) -> Result<(), MailError>
Sourcepub fn account(&self) -> Option<&ParticipantId>
pub fn account(&self) -> Option<&ParticipantId>
The account this address ultimately names: itself for Self::Direct,
the owning account for Self::Session, None for Self::Room
(a room has no owning account).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Address
impl<'de> Deserialize<'de> for Address
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>,
Source§impl Display for Address
impl Display for Address
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
The shape a human or a tool argument writes – claude for the
account, claude/s-7f3a... for one of its sessions, #room-1 for a
room – not the wire shape. The wire shape stays the tagged JSON
object Serialize/Deserialize above produce; this is a second,
display-only encoding, chosen to match
mailbox-service-extraction-and-signed-session-identity-2026-09-16.md
§5e’s own example.
impl Eq for Address
Source§impl FromStr for Address
impl FromStr for Address
Source§fn from_str(value: &str) -> Result<Self, Self::Err>
fn from_str(value: &str) -> Result<Self, Self::Err>
Parses the same shape [Display] writes: a leading # names a
room; one / splits an account from one of its sessions; anything
else is the account address directly. A room id and a participant id
share the same charset (see their own new methods), so the
leading # is what disambiguates a room from an account whose name
happens to look the same – neither charset permits # or /, so
there is nothing for either component to accidentally supply.