pub enum CollectStrategy {
DeviceBasedStrategy {
only_allow_trusted_devices: bool,
error_on_verified_user_problem: bool,
},
IdentityBasedStrategy,
}
Expand description
Strategy to collect the devices that should receive room keys for the current discussion.
Variants§
DeviceBasedStrategy
Device based sharing strategy.
Fields
only_allow_trusted_devices: bool
If true
, devices that are not trusted will be excluded from the
conversation. A device is trusted if any of the following is true:
- It was manually marked as trusted.
- It was marked as verified via interactive verification.
- It is signed by its owner identity, and this identity has been
trusted via interactive verification.
- It is the current own device of the user.
error_on_verified_user_problem: bool
If true
, and a verified user has an unsigned device, key sharing
will fail with a
SessionRecipientCollectionError::VerifiedUserHasUnsignedDevice
.
If true
, and a verified user has replaced their identity, key
sharing will fail with a
SessionRecipientCollectionError::VerifiedUserChangedIdentity
.
Otherwise, keys are shared with unsigned devices as normal.
Once the problematic devices are blacklisted or whitelisted the caller can retry to share a second time.
IdentityBasedStrategy
Share based on identity. Only distribute to devices signed by their owner. If a user has no published identity he will not receive any room keys.
Implementations§
source§impl CollectStrategy
impl CollectStrategy
sourcepub const fn new_identity_based() -> Self
pub const fn new_identity_based() -> Self
Creates an identity based strategy
Trait Implementations§
source§impl Clone for CollectStrategy
impl Clone for CollectStrategy
source§fn clone(&self) -> CollectStrategy
fn clone(&self) -> CollectStrategy
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CollectStrategy
impl Debug for CollectStrategy
source§impl Default for CollectStrategy
impl Default for CollectStrategy
source§impl<'de> Deserialize<'de> for CollectStrategy
impl<'de> Deserialize<'de> for CollectStrategy
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>,
source§impl PartialEq for CollectStrategy
impl PartialEq for CollectStrategy
source§fn eq(&self, other: &CollectStrategy) -> bool
fn eq(&self, other: &CollectStrategy) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for CollectStrategy
impl Serialize for CollectStrategy
impl StructuralPartialEq for CollectStrategy
Auto Trait Implementations§
impl Freeze for CollectStrategy
impl RefUnwindSafe for CollectStrategy
impl Send for CollectStrategy
impl Sync for CollectStrategy
impl Unpin for CollectStrategy
impl UnwindSafe for CollectStrategy
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§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