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