Struct ProposalBundle

Source
pub struct ProposalBundle { /* private fields */ }
Expand description

A collection of proposals.

Implementations§

Source§

impl ProposalBundle

Source

pub fn add( &mut self, proposal: Proposal, sender: Sender, source: ProposalSource, )

Source

pub fn remove<T: Proposable>(&mut self, index: usize)

Remove the proposal of type T at index

Type T can be any of the standard MLS proposal types defined in the proposal module.

index is consistent with the index returned by any of the proposal type specific functions in this module.

Source

pub fn by_type<'a, T: Proposable + 'a>( &'a self, ) -> impl Iterator<Item = &'a ProposalInfo<T>>

Iterate over proposals, filtered by type.

Type T can be any of the standard MLS proposal types defined in the proposal module.

Source

pub fn retain_by_type<T, F, E>(&mut self, f: F) -> Result<(), E>
where T: Proposable, F: FnMut(&ProposalInfo<T>) -> Result<bool, E>,

Retain proposals, filtered by type.

Type T can be any of the standard MLS proposal types defined in the proposal module.

Source

pub fn retain_custom<F, E>(&mut self, f: F) -> Result<(), E>

Retain custom proposals in the bundle.

Source

pub fn retain<F, E>(&mut self, f: F) -> Result<(), E>

Retain MLS standard proposals in the bundle.

Source

pub fn length(&self) -> usize

The number of proposals in the bundle

Source

pub fn iter_proposals( &self, ) -> impl Iterator<Item = ProposalInfo<BorrowedProposal<'_>>>

Iterate over all proposals inside the bundle.

Source

pub fn into_proposals(self) -> impl Iterator<Item = ProposalInfo<Proposal>>

Iterate over proposal in the bundle, consuming the bundle.

Source

pub fn add_proposals(&self) -> &[ProposalInfo<AddProposal>]

Add proposals in the bundle.

Source

pub fn update_proposals(&self) -> &[ProposalInfo<UpdateProposal>]

Update proposals in the bundle.

Source

pub fn update_proposal_senders(&self) -> &[LeafIndex]

Senders of update proposals in the bundle.

Source

pub fn remove_proposals(&self) -> &[ProposalInfo<RemoveProposal>]

Remove proposals in the bundle.

Source

pub fn psk_proposals(&self) -> &[ProposalInfo<PreSharedKeyProposal>]

Pre-shared key proposals in the bundle.

Source

pub fn reinit_proposals(&self) -> &[ProposalInfo<ReInitProposal>]

Reinit proposals in the bundle.

Source

pub fn external_init_proposals(&self) -> &[ProposalInfo<ExternalInit>]

External init proposals in the bundle.

Source

pub fn group_context_ext_proposals(&self) -> &[ProposalInfo<ExtensionList>]

Group context extension proposals in the bundle.

Source

pub fn custom_proposals(&self) -> &[ProposalInfo<CustomProposal>]

Custom proposals in the bundle.

Source

pub fn custom_proposal_types(&self) -> impl Iterator<Item = ProposalType> + '_

Custom proposal types that are in use within this bundle.

Source

pub fn proposal_types(&self) -> impl Iterator<Item = ProposalType> + '_

Standard proposal types that are in use within this bundle.

Trait Implementations§

Source§

impl Clone for ProposalBundle

Source§

fn clone(&self) -> ProposalBundle

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ProposalBundle

Source§

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

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

impl Default for ProposalBundle

Source§

fn default() -> ProposalBundle

Returns the “default value” for a type. Read more
Source§

impl<'a> FromIterator<&'a (ProposalRef, CachedProposal)> for ProposalBundle

Source§

fn from_iter<I>(iter: I) -> Self
where I: IntoIterator<Item = &'a (ProposalRef, CachedProposal)>,

Creates a value from an iterator. Read more
Source§

impl<'a> FromIterator<(&'a ProposalRef, &'a CachedProposal)> for ProposalBundle

Source§

fn from_iter<I>(iter: I) -> Self
where I: IntoIterator<Item = (&'a ProposalRef, &'a CachedProposal)>,

Creates a value from an iterator. Read more
Source§

impl FromIterator<(Proposal, Sender, ProposalSource)> for ProposalBundle

Source§

fn from_iter<I>(iter: I) -> Self

Creates a value from an iterator. 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
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
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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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 = 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.