namespace NATS.Server.JetStream.Snapshots;

public sealed class StreamSnapshotService
{
    public ValueTask<byte[]> SnapshotAsync(StreamHandle stream, CancellationToken ct)
        => stream.Store.CreateSnapshotAsync(ct);

    public ValueTask RestoreAsync(StreamHandle stream, ReadOnlyMemory<byte> snapshot, CancellationToken ct)
        => stream.Store.RestoreSnapshotAsync(snapshot, ct);
}
