pub struct CommunityInvite {
pub community_id: String,
pub name: String,
pub server_root_key: String,
pub server_root_epoch: u64,
pub relays: Vec<String>,
pub channels: Vec<InviteChannel>,
pub owner_attestation: Option<String>,
pub icon: Option<CommunityImage>,
}Expand description
Everything a new member needs to join a Community.
Fields§
§community_id: String§name: String§server_root_key: String§server_root_epoch: u64The server-root’s current epoch, so a joiner adopts the right base read clock. default
keeps older bundles parseable (they predate rotation, so epoch 0 is correct for them).
relays: Vec<String>§channels: Vec<InviteChannel>§owner_attestation: Option<String>Owner attestation (signed event JSON) so the joiner learns + verifies who the owner
is. serde(default) keeps older bundles (pre-feature) parseable.
icon: Option<CommunityImage>Community icon (encrypted blob ref) so a PARKED private invite can show the logo before the
recipient joins (the card fetches + decrypts it like a public-invite preview). STRIPPED from
Community List blobs (see list.rs) since a rehydrating device folds the icon from the community
metadata; it’s only carried in the actual invite bundle. default keeps icon-less bundles parseable.
Implementations§
Source§impl CommunityInvite
impl CommunityInvite
pub fn to_json(&self) -> Result<String, String>
pub fn from_json(json: &str) -> Result<Self, String>
Sourcepub fn validate(&self) -> Result<(), String>
pub fn validate(&self) -> Result<(), String>
Reject a bundle whose channel count exceeds the MVP ceiling (DoS guard for inbound,
attacker-controlled bundles). Relays are capped by truncation (cap_relays), not rejection,
so a >5 or legacy bundle degrades to the cap rather than failing the whole join.
Trait Implementations§
Source§impl Clone for CommunityInvite
impl Clone for CommunityInvite
Source§fn clone(&self) -> CommunityInvite
fn clone(&self) -> CommunityInvite
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§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>,
impl Eq for CommunityInvite
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 Freeze 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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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