Skip to content

Struct client::member::InvitePayload

zaun_community_protocol::client::member::InvitePayload · Struct

pub struct InvitePayload { … }

The canonical InvitePayload. Unsigned: after connecting, the welcome must show a descriptor deriving community_id, a delegation naming host_id, and a host proof — which InvitePayload::session_config makes the session check.

Debug never shows the secret (InviteSecret is redacted); it is zeroized on drop.

The community.

The host to connect to.

The host’s SimpleX contact address, ≤ 2 048 bytes.

The invitation secret.

Expiry, ms; none = never.

Lowest protocol version of the community.

Highest protocol version of the community.

pub fn parse(link: &str) -> Result<Self, LinkError>

Parses a link strictly: prefix, canonical base64url, canonical payload, no trailing bytes. Decoded bytes are zeroized.

LinkError, which never echoes the input.

pub fn to_link(&self) -> Result<InviteLink, LinkError>

Formats the link. The intermediate bytes are zeroized; the returned link is redacted in Debug.

LinkError::Field for an empty or oversized address or a bad version range.

pub fn is_expired(&self, now_ms: u64) -> bool

Whether the invitation has expired at now_ms.

pub const fn supports(&self, ours: VersionRange) -> bool

Whether the community’s version range overlaps ours.

pub fn session_config(&self) -> SessionConfig

A session configuration that pins the link’s host and community.

Clone, Debug, Eq, PartialEq, StructuralPartialEq

Full rustdoc page