pub struct CommunityInvite {Show 14 fields
pub community_id: String,
pub owner: String,
pub owner_salt: String,
pub community_root: String,
pub root_epoch: u64,
pub control_pk: Option<String>,
pub channels: Vec<ChannelGrant>,
pub relays: Vec<String>,
pub name: String,
pub icon: Option<ImageRef>,
pub expires_at: Option<u64>,
pub creator_npub: Option<String>,
pub label: Option<String>,
pub extra: Map<String, Value>,
}Expand description
The CommunityInvite bundle (CORD-05 §1). Field names are wire-frozen and
shared with Soapbox/Armada; a rename is a silent cross-client join failure.
Fields§
§community_id: Stringsha256("concord/community" || owner || owner_salt) — self-certifies the owner.
owner: StringOwner x-only pubkey (32-byte hex).
owner_salt: StringOwner salt (32-byte hex).
community_root: StringThe base access key (32-byte hex) at root_epoch.
root_epoch: u64§control_pk: Option<String>The Control Plane’s signer pubkey at root_epoch (CORD-02 §5):
subscribe, verify, read — never write. Absent = a legacy, pre-split
Community (fold Control at the legacy address instead, CORD-06 §3).
Taken on trust — it derives from a secret the joiner never holds, so
nothing in the bundle can prove it; a wrong one is eclipse-class
self-harm by the inviter, never forged authority (CORD-05 §1).
channels: Vec<ChannelGrant>ABSENT, not empty, when the bundle vends no channel keys — armada omits it (and re-fills it defensively on read). A required Vec here rejects the whole bundle, which is a JOIN failure, not just a stale read.
relays: Vec<String>§name: StringPreview name so a parked invite renders; the Control fold is the authority.
icon: Option<ImageRef>§expires_at: Option<u64>Optional, unix ms: past it the preview still renders, joining refuses.
creator_npub: Option<String>Optional attribution, echoed in the joiner’s Guestbook Join (CORD-05 §1).
label: Option<String>§extra: Map<String, Value>Unknown fields round-trip verbatim (CORD-02 §6) — carries other clients’
bundle extensions (held_roots, refounder, …) through untouched.
Implementations§
Source§impl CommunityInvite
impl CommunityInvite
Sourcepub fn from_bundle_json(json: &str) -> Result<Self, InviteError>
pub fn from_bundle_json(json: &str) -> Result<Self, InviteError>
Parse + bound + validate a decrypted bundle, whichever lane carried it:
truncate relays to the Community cap, reject an over-count of Channels
before trusting it, and verify the owner commitment.
Sourcepub fn validate(&self) -> Result<(), InviteError>
pub fn validate(&self) -> Result<(), InviteError>
The self-certifying owner check (CORD-02 A.4) plus the Channel bound — a mismatching bundle is refused, so even a compromised creator can’t smuggle a false owner or a fake key for a real Community.
Sourcepub fn expired(&self, now_ms: u64) -> bool
pub fn expired(&self, now_ms: u64) -> bool
Whether the invite’s shelf life has run out (expires_at is unix ms).
Deliberately NOT checked at parse: a parked invite still renders past
expiry, only joining refuses (CORD-05 §1).
Sourcepub fn attribution(&self) -> (Option<&str>, Option<&str>)
pub fn attribution(&self) -> (Option<&str>, Option<&str>)
The attribution a joiner echoes into their Join: a 64-hex creator and a label within the cap, anything else echoed as absent (CORD-05 §1).
Sourcepub fn fits(&self, lane: BundleLane) -> bool
pub fn fits(&self, lane: BundleLane) -> bool
Whether this bundle’s event fits a relay on lane.
Sourcepub fn fit(&mut self, lane: BundleLane)
pub fn fit(&mut self, lane: BundleLane)
Shed public Channel grants, last first, until the bundle fits lane. A joiner derives
a public Channel from the root and folds it from Control, so only a private Channel’s
key must ride the bundle; one that still won’t fit is refused when it is sent.
Trait Implementations§
Source§impl Clone for CommunityInvite
impl Clone for CommunityInvite
Source§impl Debug for CommunityInvite
impl Debug for CommunityInvite
Source§impl<'de> Deserialize<'de> for CommunityInvite
impl<'de> Deserialize<'de> for CommunityInvite
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 PartialEq for CommunityInvite
impl PartialEq for CommunityInvite
Source§impl Serialize for CommunityInvite
impl Serialize for CommunityInvite
impl StructuralPartialEq for CommunityInvite
Auto Trait Implementations§
impl Forget for CommunityInvite
impl Freeze for CommunityInvite
impl Move for CommunityInvite
impl RefUnwindSafe for CommunityInvite
impl Send for CommunityInvite
impl Sync for CommunityInvite
impl Unpin for CommunityInvite
impl UnsafeUnpin for CommunityInvite
impl UnwindSafe for CommunityInvite
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more