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>,
}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.
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
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for CommunityInvite
Source§impl PartialEq for CommunityInvite
impl PartialEq for CommunityInvite
Source§fn eq(&self, other: &CommunityInvite) -> bool
fn eq(&self, other: &CommunityInvite) -> bool
Tests for
self and other values to be equal, and is used by ==.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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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