Signal-iOS/SignalServiceKit/MessageBackup/Archivers/Recipient/MessageBackupRecipientDestinationArchiver.swift
2024-04-26 14:55:47 -07:00

20 lines
747 B
Swift

//
// Copyright 2023 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
//
import Foundation
import LibSignalClient
/**
* Writes and reads ``BackupProto.Recipient`` frames to/from the backup proto.
*
* Different types of recipient objects are fanned out to the different concrete implementations of this protocol.
*/
internal protocol MessageBackupRecipientDestinationArchiver: MessageBackupRecipientArchiver {
/// This method will be called to determine which archiver to use to restore a particular ``BackupProto.Recipient`` frame.
/// These should be mutually exclusive among all concrete subclasses; typically just presence of a oneOf field.
static func canRestore(_ recipient: BackupProto.Recipient) -> Bool
}