matrix_sdk_crypto/types/requests/
keys_backup.rs

1// Copyright 2020 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 std::collections::BTreeMap;
16
17use ruma::{api::client::backup::RoomKeyBackup, OwnedRoomId};
18
19/// A request that will back up a batch of room keys to the server.
20#[derive(Clone, Debug)]
21pub struct KeysBackupRequest {
22    /// The backup version that these room keys should be part of.
23    pub version: String,
24    /// The map from room id to a backed up room key that we're going to upload
25    /// to the server.
26    pub rooms: BTreeMap<OwnedRoomId, RoomKeyBackup>,
27}