#nullable enable using System.IO; using System.Threading; using System.Threading.Tasks; namespace Duplicati.Library.Interface { /// /// Implements a destination where data can be restored to /// public interface IDestinationProvider : IDynamicModule { /// /// Gets the module key /// string Key { get; } /// /// Gets the display name of the module /// string DisplayName { get; } /// /// Checks if a restore is needed /// /// The path to restore to /// The hash of the data to restore /// The hash of the metadata to restore /// The cancellation token /// True if a restore is needed, false otherwise Task IsRestoreNeededAsync(string path, string dataHash, string? metadataHash, CancellationToken cancel); /// /// Restores a file to the given path /// /// The path to restore to /// The data stream to restore /// The metadata stream to restore /// The cancellation token /// A task that completes when the restore is done Task WriteAsync(string path, Stream data, Stream? metadata, CancellationToken cancel); } }