Skip to main content

StoreChange

Enum StoreChange 

Source
pub enum StoreChange {
Show 21 variants CreateStore { store: StoreId, name: String, admin: MemberPublicKeys, key: KeyId, key_hash: [u8; 32], device_name: String, person: String, circle: NewCircle, circles: Vec<NewCircle>, }, SetUpStorage { access: MemberAccess, }, RenameStore { name: String, }, AdmitMember { member: MemberId, keys: MemberPublicKeys, role: MemberRole, access: MemberAccess, device: DeviceId, device_name: String, person: String, circle: NewCircle, }, RecoverMember { member: MemberId, expected: MemberPublicKeys, keys: MemberPublicKeys, access: Option<MemberAccess>, device: DeviceId, device_name: String, circle: NewCircle, }, SetAccess { member: MemberId, access: MemberAccess, }, RemoveMember { member: MemberId, }, ChangeRole { member: MemberId, role: MemberRole, }, AddDevice { name: String, replaces: Option<DeviceId>, }, RemoveDevice { device: DeviceId, }, CreateCircle { circle: CircleId, name: String, breaking_version: u32, key: KeyId, key_hash: [u8; 32], }, RenameCircle { circle: CircleId, name: String, }, DeleteCircle { circle: CircleId, }, AddCircleMember { circle: CircleId, member: MemberId, }, RemoveCircleMember { circle: CircleId, member: MemberId, key: KeyId, key_hash: [u8; 32], }, RotateKey { audience: Audience, key: KeyId, key_hash: [u8; 32], }, RaiseSchema { version: u32, announcement: Slot, }, Reset { announcement: Slot, }, ReplaceMemberKeys { member: MemberId, expected: MemberPublicKeys, keys: MemberPublicKeys, }, AddInviteShare { invite: InviteId, account: String, }, EndInviteShare { invite: InviteId, },
}
Expand description

Every admin operation listed in §10, including store creation.

Variants§

§

CreateStore

Create a store, name its first admin and register the writing device. The entry’s author is the first admin’s stable id; admin supplies that member’s initial pair, which verifies this entry (D6). It records no storage access: SetUpStorage does, once storage exists.

Fields

§store: StoreId

The store’s id.

§name: String

The store’s name.

§admin: MemberPublicKeys

The first admin’s initial public pair.

§key: KeyId

The first store key, introduced by this entry.

§key_hash: [u8; 32]

SHA-256 of the exact 32 store-key bytes.

§device_name: String

The name of the device that wrote this entry, belonging to its author.

§person: String

The creator’s name, which every device of hers writes her profile with, as an admission’s person is a joiner’s (§13.2).

§circle: NewCircle

The creator’s private circle, whose only member she is, as an admission’s circle is a joiner’s.

§circles: Vec<NewCircle>

The circles the creator’s first write asks for, each with the creator as its first member, in the order they were asked for.

§

SetUpStorage

Record how the store’s first admin reaches storage, which fixes the kind of access every member has and, for a provider account, the account that holds the store (§10.3). Applies once, as an admin in the preceding state; access entries, admissions and invite shares wait for it.

Fields

§access: MemberAccess

The author’s provider account, or the public S3 key id they use.

§

RenameStore

Set the store name, as an admin in the preceding state (§10).

Fields

§name: String

The new name.

§

AdmitMember

Admit a joining person: add their stable id with both public keys, their initial role and access, and register the device their request names. Only an admission slot holds it, beside the member’s key copies (§13.2, D9).

Fields

§member: MemberId

The added member’s stable id, fixed by the admin’s invite.

§keys: MemberPublicKeys

The member’s initial public pair.

§role: MemberRole

The initial role.

§access: MemberAccess

Storage access granted by the inviting owner.

§device: DeviceId

The joining installation, registered for the member. Never the writing device.

§device_name: String

The joining installation’s name, from its request.

§person: String

The name the member’s request carried: the person’s, which every device of theirs writes their profile with (§13.2).

§circle: NewCircle

The circle the member’s request made, whose only member they are.

§

RecoverMember

Recover an active member on a new device: rebind their pair, as replace-member-keys does, set their access when the invite carried a new S3 key, and register the device their request names. Only an admission slot holds it (§13.2, D9).

Fields

§member: MemberId

The recovered member.

§expected: MemberPublicKeys

The binding which must still be current before this slot.

§keys: MemberPublicKeys

The member’s new public pair.

§access: Option<MemberAccess>

The member’s new storage access, as set-access records it: the S3 key the recovery invite carries. None keeps their access.

§device: DeviceId

The new installation, registered for the member. Never the writing device.

§device_name: String

The new installation’s name, from its request.

§circle: NewCircle

The new circle the member’s request made, whose only member they are: their old private circle has no reader left.

§

SetAccess

Record a member’s current storage access, used by a later removal (§10): the author’s own, or an admin’s replacement S3 key for another member.

Fields

§member: MemberId

The member whose access this records.

§access: MemberAccess

The provider account, or the S3 key id and its principal; no credentials.

§

RemoveMember

Remove a member and delete circles left empty (§14.1).

Fields

§member: MemberId

The removed member.

§

ChangeRole

Set a member’s role.

Fields

§member: MemberId

The affected member.

§role: MemberRole

The target role.

§

AddDevice

Register the writing install for the entry’s author: an install registers only itself (§10.2).

Fields

§name: String

The device’s name.

§replaces: Option<DeviceId>

The older install of the same member being replaced, if any (§19.3). Must differ from the writing device.

§

RemoveDevice

Remove a device’s access.

Fields

§device: DeviceId

The removed install.

§

CreateCircle

Make a circle with its creator as its first member.

Fields

§circle: CircleId

The new circle’s id.

§name: String

The circle’s name.

§breaking_version: u32

The newest breaking migration its maker’s app had run, zero if none: the circle’s schema version until a raise of its own goes past it (§15.5, §16.3).

§key: KeyId

The first circle key, introduced by this entry.

§key_hash: [u8; 32]

SHA-256 of the exact 32 circle-key bytes.

§

RenameCircle

Rename a circle without changing its members, keys or rows.

Fields

§circle: CircleId

The circle being renamed.

§name: String

Its new name.

§

DeleteCircle

Delete a circle (§15.9).

Fields

§circle: CircleId

The deleted circle.

§

AddCircleMember

Add a store member to a circle (§15.5).

Fields

§circle: CircleId

The circle being joined.

§member: MemberId

The added member.

§

RemoveCircleMember

Remove a circle member, deleting the circle if left empty, and introduce the circle’s replacement key (§15.8).

Fields

§circle: CircleId

The circle being left.

§member: MemberId

The removed member.

§key: KeyId

The replacement circle key, introduced by this entry.

§key_hash: [u8; 32]

SHA-256 of the exact 32 circle-key bytes.

§

RotateKey

Introduce a key without changing audience membership (§12.1).

Fields

§audience: Audience

The audience whose member authored the rotation.

§key: KeyId

The introduced key’s id, which the id source supplied.

§key_hash: [u8; 32]

SHA-256 of the exact 32 key bytes.

§

RaiseSchema

Raise an audience’s app schema version with its replacement snapshot (§18.3).

Fields

§version: u32

The new schema version.

§announcement: Slot

The earlier announcement of the prepared snapshot.

§

Reset

Reset the store’s or a circle’s rows to a snapshot (§19.4).

Fields

§announcement: Slot

The earlier announcement of the prepared reset snapshot.

§

ReplaceMemberKeys

Replace an active member’s public pair, keeping their id, role, access, circles and devices (§10). It carries no audience keys.

Fields

§member: MemberId

The member whose keys change.

§expected: MemberPublicKeys

The binding which must still be current before this slot.

§keys: MemberPublicKeys

The member’s new public pair.

§

AddInviteShare

Record that the writing device’s invite shares the store with a provider account (§13.2, §14.2). Claimed before the grant, so the owner’s other devices know of the share and take it back once the invite ends or its device is gone for good.

Fields

§invite: InviteId

The invite, fixed when it was made.

§account: String

The provider account the invite shares the store with.

§

EndInviteShare

End the share the writing device recorded for its invite (§13.2).

Fields

§invite: InviteId

The invite whose share ends.

Implementations§

Source§

impl StoreChange

Source

pub fn made_circle(&self) -> Option<&CircleId>

The circle this change makes: a circle’s creation, or an admission making its member’s.

Source

pub fn created_circles(&self) -> impl Iterator<Item = &NewCircle>

The circles a store’s creation makes, in the order slot 1 makes them: the creator’s private circle, then each circle her first write asks for. Every other change makes none of these.

Source§

impl StoreChange

Source

pub fn encode(&self) -> Result<Vec<u8>, Error>

Encode the one bounded kind-4 admin frame (D6).

Source

pub fn decode(bytes: &[u8]) -> Result<Self, Error>

Decode exactly one admin frame. Slot-dependent authorization is separate.

Trait Implementations§

Source§

impl Clone for StoreChange

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StoreChange

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for StoreChange

Source§

impl PartialEq for StoreChange

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for StoreChange

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more