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
§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§fn write(obj: Self, buf: &mut Vec<u8>)
fn write(obj: Self, buf: &mut Vec<u8>)
source§fn try_read(buf: &mut &[u8]) -> Result<Self>
fn try_read(buf: &mut &[u8]) -> Result<Self>
source§const TYPE_ID_META: MetadataBuffer = _
const TYPE_ID_META: MetadataBuffer = _
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
§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
§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§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
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,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§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