Skip to content

Commit 670e212

Browse files
committed
docs(crypto): Fill out the docs for the backup related types
1 parent 6fc703b commit 670e212

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

crates/matrix-sdk-crypto/src/backups/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ impl BackupMachine {
232232
}
233233

234234
/// Encrypt a batch of room keys and return a request that needs to be sent
235-
/// out to backup room keys.
235+
/// out to backup the room keys.
236236
pub async fn backup(&self) -> Result<Option<OutgoingRequest>, CryptoStoreError> {
237237
let mut request = self.pending_backup.write().await;
238238

crates/matrix-sdk-crypto/src/machine.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,7 +1502,8 @@ impl OlmMachine {
15021502
Ok(())
15031503
}
15041504

1505-
/// TODO
1505+
/// Sign the given message using our device key and if available cross
1506+
/// signing master key.
15061507
pub async fn sign(&self, message: &str) -> BTreeMap<UserId, BTreeMap<DeviceKeyId, String>> {
15071508
let mut signatures: BTreeMap<_, BTreeMap<_, _>> = BTreeMap::new();
15081509

@@ -1515,7 +1516,10 @@ impl OlmMachine {
15151516
signatures
15161517
}
15171518

1518-
/// TODO
1519+
/// Get a reference to the backup related state machine.
1520+
///
1521+
/// This state machine can be used to incrementally backup all room keys to
1522+
/// the server.
15191523
#[cfg(feature = "backups_v1")]
15201524
pub fn backup_machine(&self) -> &BackupMachine {
15211525
&self.backup_machine

crates/matrix-sdk-crypto/src/requests.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ pub enum OutgoingRequests {
198198
/// A room message request, usually for sending in-room interactive
199199
/// verification events.
200200
RoomMessage(RoomMessageRequest),
201-
/// TODO
201+
/// A request that will back up a batch of room keys to the server.
202202
KeysBackup(KeysBackupRequest),
203203
}
204204

@@ -287,7 +287,7 @@ pub enum IncomingResponse<'a> {
287287
SignatureUpload(&'a SignatureUploadResponse),
288288
/// A room message response, usually for interactive verifications.
289289
RoomMessage(&'a RoomMessageResponse),
290-
/// TODO
290+
/// Response for the server-side room key backup request.
291291
KeysBackup(&'a KeysBackupResponse),
292292
}
293293

@@ -373,12 +373,13 @@ pub struct RoomMessageRequest {
373373
pub content: AnyMessageEventContent,
374374
}
375375

376-
/// TODO
376+
/// A request that will back up a batch of room keys to the server.
377377
#[derive(Clone, Debug)]
378378
pub struct KeysBackupRequest {
379-
/// TODO
379+
/// The backup version that these room keys should be part of.
380380
pub version: String,
381-
/// TODO
381+
/// The map from room id to a backed up room key that we're going to upload
382+
/// to the server.
382383
pub rooms: BTreeMap<RoomId, RoomKeyBackup>,
383384
}
384385

0 commit comments

Comments
 (0)