pub struct InvitePayload {
pub community_id: CommunityId,
pub host_id: HostId,
pub host_address: String,
pub invite_secret: InviteSecret,
pub expires_at: Option<u64>,
pub protocol_min: u16,
pub protocol_max: u16,
}Expand description
The canonical InvitePayload (§8.6). 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.
Fields§
§community_id: CommunityIdThe community.
host_id: HostIdThe host to connect to.
host_address: StringThe host’s SimpleX contact address, ≤ 2 048 bytes.
invite_secret: InviteSecretThe invitation secret.
expires_at: Option<u64>Expiry, ms; none = never.
protocol_min: u16Lowest protocol version of the community.
protocol_max: u16Highest protocol version of the community.
Implementations§
Source§impl InvitePayload
impl InvitePayload
Sourcepub fn to_link(&self) -> Result<InviteLink, LinkError>
pub fn to_link(&self) -> Result<InviteLink, LinkError>
Formats the link. The intermediate bytes are zeroized; the returned link is redacted
in Debug.
§Errors
LinkError::Field for an empty or oversized address or a bad version range.
Sourcepub fn is_expired(&self, now_ms: u64) -> bool
pub fn is_expired(&self, now_ms: u64) -> bool
Whether the invitation has expired at now_ms.
Sourcepub const fn supports(&self, ours: VersionRange) -> bool
pub const fn supports(&self, ours: VersionRange) -> bool
Whether the community’s version range overlaps ours.
Sourcepub fn session_config(&self) -> SessionConfig
pub fn session_config(&self) -> SessionConfig
A session configuration that pins the link’s host and community (§8.6).
Trait Implementations§
Source§impl Clone for InvitePayload
impl Clone for InvitePayload
Source§fn clone(&self) -> InvitePayload
fn clone(&self) -> InvitePayload
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more