Skip to main content

ProcessedMessageContent

Enum ProcessedMessageContent 

Source
pub enum ProcessedMessageContent {
    ApplicationMessage(ApplicationMessage),
    ProposalMessage(Box<QueuedProposal>),
    ExternalJoinProposalMessage(Box<QueuedProposal>),
    StagedCommitMessage(Box<StagedCommit>),
    OwnPendingCommit,
    OwnPrivateMessage,
    UnresolvedAppDataCommit(Box<UnresolvedAppDataCommit>),
}
Available on 32-bit or 64-bit only.
Expand description

Content of a processed message.

See the content variants’ documentation for more information. StagedCommit and QueuedProposal can be inspected for authorization purposes.

Variants§

§

ApplicationMessage(ApplicationMessage)

An application message.

The ApplicationMessage contains a vector of bytes that can be used right-away.

§

ProposalMessage(Box<QueuedProposal>)

A standalone proposal.

The QueuedProposal can be inspected for authorization purposes by the application. If the proposal is deemed to be allowed, it should be added to the group’s proposal queue using MlsGroup::store_pending_proposal().

§

ExternalJoinProposalMessage(Box<QueuedProposal>)

An external join proposal sent by a NewMemberProposal sender which is outside the group.

Since this originates from a party outside the group, the QueuedProposal SHOULD be inspected for authorization purposes by the application. If the proposal is deemed to be allowed, it should be added to the group’s proposal queue using MlsGroup::store_pending_proposal().

§

StagedCommitMessage(Box<StagedCommit>)

A Commit message.

The StagedCommit can be inspected for authorization purposes by the application. If the type of the commit and the proposals it covers are deemed to be allowed, the commit should be merged into the group’s state using MlsGroup::merge_staged_commit().

§

OwnPendingCommit

A Commit authored by this client that it got fanned out by the delivery service, matching the group’s pending commit.

This is returned instead of StagedCommitMessage when the processed Commit was created by this client and matches the group’s pending commit. Since this client already holds the corresponding pending commit, the incoming Commit is not staged. To apply it, merge the pending commit using MlsGroup::merge_pending_commit(). An own Commit that does not match the pending commit is instead returned as a StagedCommitMessage (if it has no UpdatePath) or rejected (if it has an UpdatePath we cannot decrypt).

The match against the pending commit is established by comparing the confirmation tag of the incoming Commit against the one stored with the pending commit. The message signature has already been verified, which authenticates the Commit as ours, and a matching confirmation tag binds the confirmed transcript hash of the new epoch. We do not otherwise compare the contents of the incoming Commit against the pending commit, and the incoming Commit’s state is never adopted.

This is only produced for Commits framed as PublicMessage. A Commit framed as a PrivateMessage cannot be decrypted by its own author and instead surfaces as OwnPrivateMessage. The exception is the virtual-clients-draft feature, where an own private Commit whose encryption secret is still retained (not yet confirmed) decrypts and can produce this variant as well. Under that feature the pending-commit match is checked before any sibling-commit (virtual clients) material is loaded, so an own Commit fanned back by the delivery service surfaces as OwnPendingCommit without consuming an operation-secret generation from the emulation epoch’s operation secret tree.

§

OwnPrivateMessage

A PrivateMessage whose sender data claims this client’s own leaf index, i.e. a message this client authored that the delivery service fanned back.

The content cannot be decrypted (the own sender ratchet is encryption-only) and the signature cannot be verified.

Applications should treat this variant as a hint to skip the message. The content type of the incoming message (application/proposal/commit) is available via ProtocolMessage::content_type() before processing, and is unauthenticated plaintext in the PrivateMessage framing.

With the virtual-clients-draft feature, own-leaf messages are decryptable while their secrets are retained: unconfirmed own sends and messages from sibling emulator clients decrypt and process normally. This variant is then only returned in groups that do not use virtual clients (no emulation state registered for the message’s epoch), when decryption of an own message fails, e.g. because the send was already confirmed via MlsGroup::confirm_application_message().

§

UnresolvedAppDataCommit(Box<UnresolvedAppDataCommit>)

Available on crate feature extensions-draft only.

A Commit message covering AppDataUpdate proposals.

The proposals carry diffs in an application-defined format, so the commit cannot be staged before the application has interpreted them and computed the resulting dictionary entries. Inspect the proposals via UnresolvedAppDataCommit::app_data_update_proposals(), compute the updates with the help of MlsGroup::app_data_dictionary_updater() and resume staging via MlsGroup::stage_app_data_commit().

This variant is likewise returned by PublicGroup::process_message(), where the updates are computed with PublicGroup::app_data_dictionary_updater() and staging resumes via PublicGroup::stage_app_data_commit().

Trait Implementations§

Source§

impl Debug for ProcessedMessageContent

Source§

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

Formats the value using the given formatter. Read more

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V