pub struct AlbumGroupAssertion {
pub group_id: Uuid,
pub group_name: Lww<String>,
pub member_hint: Vec<MemberHint>,
pub signature: Option<HybridSignature>,
}Expand description
The album-group assertion — client-side group metadata, asserted per constituent and written into that album’s collaborative-metadata stream. This type owns the schema (SSoT: Federation — The Album-Group Assertion).
The union of per-album assertions is the group; there is no shared mutable group object.
group_name converges across participants by LWW exactly like caption_lww, so a concurrent
rename on two constituents reconciles to one name regardless of arrival order.
Fields§
§group_id: UuidThe group this constituent asserts membership of (UUIDv7, minted by the creator).
group_name: Lww<String>The group’s display name — an LWW register that converges across every participant’s
assertion, like caption_lww (SSoT: Metadata — Collaborative Metadata).
member_hint: Vec<MemberHint>Advisory sibling hints — where the other constituents are claimed to live. Never trusted for admission; only used to know where to ask.
signature: Option<HybridSignature>Device signature over the assertion’s canonical bytes — the assertion is a device-signed
operation on the collaborative-metadata op path, provenance-tracked like a
metadata-update. None until sign is called.
Implementations§
Source§impl AlbumGroupAssertion
impl AlbumGroupAssertion
Sourcepub fn new(
group_id: Uuid,
name: impl Into<String>,
ts: impl Into<String>,
device: Uuid,
member_hint: Vec<MemberHint>,
) -> Self
pub fn new( group_id: Uuid, name: impl Into<String>, ts: impl Into<String>, device: Uuid, member_hint: Vec<MemberHint>, ) -> Self
A fresh assertion for group_id naming the group name (stamped by (ts, device) for
LWW convergence) with the given advisory sibling hints. Unsigned — the caller
signs it.
Sourcepub fn signing_bytes(&self) -> Vec<u8> ⓘ
pub fn signing_bytes(&self) -> Vec<u8> ⓘ
The canonical bytes the signature covers (everything except signature).
Sourcepub fn sign(&mut self, ik: &HybridSigningKey)
pub fn sign(&mut self, ik: &HybridSigningKey)
Sign the assertion with the author’s identity key, setting signature. Re-signable after
a mutation (a rename or hint merge) — the caller clears and re-signs.
Sourcepub fn verify(&self, ik_public: &HybridVerifyingKey) -> bool
pub fn verify(&self, ik_public: &HybridVerifyingKey) -> bool
Verify the assertion’s signature against the author’s identity public key.
Sourcepub fn asserts(&self, group_id: Uuid) -> bool
pub fn asserts(&self, group_id: Uuid) -> bool
Whether this assertion asserts group_id — the asserts-group half of the inclusion
rule. An assertion for a different group id (or none) never pulls its album into group_id’s
view.
Sourcepub fn merge(&mut self, other: &Self) -> bool
pub fn merge(&mut self, other: &Self) -> bool
Merge another constituent’s assertion for the same group into this one: LWW-merge the
group name (rename convergence) and union the advisory sibling hints. A mismatched
group_id is ignored (returns false) — assertions for different groups never cross-talk.
The result is unsigned (the merged value is this reader’s reconciled local state, not a new
authored write); sign before re-emitting it as an operation.
Trait Implementations§
Source§impl Clone for AlbumGroupAssertion
impl Clone for AlbumGroupAssertion
Source§fn clone(&self) -> AlbumGroupAssertion
fn clone(&self) -> AlbumGroupAssertion
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 AlbumGroupAssertion
impl Debug for AlbumGroupAssertion
Source§impl<'de> Deserialize<'de> for AlbumGroupAssertion
impl<'de> Deserialize<'de> for AlbumGroupAssertion
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 AlbumGroupAssertion
Source§impl PartialEq for AlbumGroupAssertion
impl PartialEq for AlbumGroupAssertion
Source§fn eq(&self, other: &AlbumGroupAssertion) -> bool
fn eq(&self, other: &AlbumGroupAssertion) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for AlbumGroupAssertion
impl Serialize for AlbumGroupAssertion
impl StructuralPartialEq for AlbumGroupAssertion
Auto Trait Implementations§
impl Freeze for AlbumGroupAssertion
impl RefUnwindSafe for AlbumGroupAssertion
impl Send for AlbumGroupAssertion
impl Sync for AlbumGroupAssertion
impl Unpin for AlbumGroupAssertion
impl UnsafeUnpin for AlbumGroupAssertion
impl UnwindSafe for AlbumGroupAssertion
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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