matrix_sdk_base/response_processors/e2ee/mod.rs
1// Copyright 2025 The Matrix.org Foundation C.I.C.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15use matrix_sdk_crypto::{OlmMachine, TrustRequirement};
16
17pub mod decrypt;
18pub mod to_device;
19pub mod tracked_users;
20
21/// A classical set of data used by some processors in this module.
22#[derive(Clone)]
23pub struct E2EE<'a> {
24 pub olm_machine: Option<&'a OlmMachine>,
25 pub decryption_trust_requirement: TrustRequirement,
26 pub verification_is_allowed: bool,
27}
28
29impl<'a> E2EE<'a> {
30 pub fn new(
31 olm_machine: Option<&'a OlmMachine>,
32 decryption_trust_requirement: TrustRequirement,
33 verification_is_allowed: bool,
34 ) -> Self {
35 Self { olm_machine, decryption_trust_requirement, verification_is_allowed }
36 }
37}