pub enum PersistedAuthority {
Reference(Box<SignedEpochLedger>),
OpenMls(ByteBuf),
}Expand description
One album’s persisted authority state, behind the
AlbumAuthority seam.
Both variants exist on every build, mls or not: a non-mls build must be able to decode
an MLS-authority album and report it as AlbumStoreError::MlsUnavailable, which it could not
do if the variant were cfg-gated away (the decode itself would fail, indistinguishable from
corruption).
Variants§
Reference(Box<SignedEpochLedger>)
The offline reference backend’s admin-signed epoch ledger. Re-verified on load. Boxed: the ledger dwarfs the MLS variant’s byte buffer, and this enum is stored per album.
OpenMls(ByteBuf)
OpenMlsAuthority::export_state
bytes (its own CBOR envelope, opaque here).
Implementations§
Source§impl PersistedAuthority
impl PersistedAuthority
Sourcepub fn capture(authority: &Authority) -> Result<Self, AlbumStoreError>
pub fn capture(authority: &Authority) -> Result<Self, AlbumStoreError>
Capture an in-memory Authority for persistence.
Sourcepub fn restore(
&self,
album_id: Uuid,
held_epochs: &BTreeSet<u32>,
) -> Result<Authority, AlbumStoreError>
pub fn restore( &self, album_id: Uuid, held_epochs: &BTreeSet<u32>, ) -> Result<Authority, AlbumStoreError>
Rebuild the live Authority. held_epochs are the epochs whose AMK this device
actually holds — the reference backend’s amk_present flags are local-only state and are
restored from the AMK rows, never from the signed ledger.
A reference ledger whose admin chain does not re-verify is LedgerRejected, and an MLS
state blob on a build without the mls feature is MlsUnavailable. Neither panics.
Trait Implementations§
Source§impl Clone for PersistedAuthority
impl Clone for PersistedAuthority
Source§fn clone(&self) -> PersistedAuthority
fn clone(&self) -> PersistedAuthority
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 PersistedAuthority
impl Debug for PersistedAuthority
Source§impl<'de> Deserialize<'de> for PersistedAuthority
impl<'de> Deserialize<'de> for PersistedAuthority
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>,
Auto Trait Implementations§
impl Freeze for PersistedAuthority
impl RefUnwindSafe for PersistedAuthority
impl Send for PersistedAuthority
impl Sync for PersistedAuthority
impl Unpin for PersistedAuthority
impl UnsafeUnpin for PersistedAuthority
impl UnwindSafe for PersistedAuthority
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<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