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<UT> ConvertError<UT> for CollectStrategy
impl<UT> ConvertError<UT> for CollectStrategy
fn try_convert_unexpected_callback_error( e: UnexpectedUniFFICallbackError, ) -> Result<Self>
Source§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<UT> FfiConverter<UT> for CollectStrategy
impl<UT> FfiConverter<UT> for CollectStrategy
Source§const TYPE_ID_META: MetadataBuffer = _
const TYPE_ID_META: MetadataBuffer = _
Source§type FfiType = RustBuffer
type FfiType = RustBuffer
Source§fn lower(v: Self) -> RustBuffer
fn lower(v: Self) -> RustBuffer
Source§fn try_lift(buf: RustBuffer) -> Result<Self>
fn try_lift(buf: RustBuffer) -> Result<Self>
Source§impl<UT> Lift<UT> for CollectStrategy
impl<UT> Lift<UT> for CollectStrategy
Source§impl<UT> LiftRef<UT> for CollectStrategy
impl<UT> LiftRef<UT> for CollectStrategy
type LiftType = CollectStrategy
Source§impl<UT> LiftReturn<UT> for CollectStrategy
impl<UT> LiftReturn<UT> for CollectStrategy
Source§type ReturnType = <CollectStrategy as Lift<UT>>::FfiType
type ReturnType = <CollectStrategy as Lift<UT>>::FfiType
Source§fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>
fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>
Source§fn lift_foreign_return(
ffi_return: Self::ReturnType,
call_status: RustCallStatus,
) -> Self
fn lift_foreign_return( ffi_return: Self::ReturnType, call_status: RustCallStatus, ) -> Self
Source§fn lift_error(_buf: RustBuffer) -> Self
fn lift_error(_buf: RustBuffer) -> Self
Source§fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
Source§impl<UT> Lower<UT> for CollectStrategy
impl<UT> Lower<UT> for CollectStrategy
type FfiType = <CollectStrategy as FfiConverter<UT>>::FfiType
fn lower(obj: Self) -> Self::FfiType
fn write(obj: Self, buf: &mut Vec<u8>)
Source§fn lower_into_rust_buffer(obj: Self) -> RustBuffer
fn lower_into_rust_buffer(obj: Self) -> RustBuffer
Source§impl<UT> LowerError<UT> for CollectStrategy
impl<UT> LowerError<UT> for CollectStrategy
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for CollectStrategy
impl<UT> LowerReturn<UT> for CollectStrategy
Source§type ReturnType = <CollectStrategy as Lower<UT>>::FfiType
type ReturnType = <CollectStrategy as Lower<UT>>::FfiType
Source§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustBuffer>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustBuffer>
Source§impl PartialEq for CollectStrategy
impl PartialEq for CollectStrategy
Source§impl Serialize for CollectStrategy
impl Serialize for CollectStrategy
Source§impl<UT> TypeId<UT> for CollectStrategy
impl<UT> TypeId<UT> for CollectStrategy
const TYPE_ID_META: MetadataBuffer = _
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,
§impl<T> CompatExt for T
impl<T> CompatExt for T
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
Source§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Arc<>
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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