Move functions to EuphVault and add EuphRoomVault

This commit moves all euph_* functions from Vault to EuphVault. The
previous EuphVault is now called EuphRoomVault and re-exports all
room-based functions from the EuphVault. It also implements MsgStore.
This commit is contained in:
Joscha 2022-09-09 18:52:54 +02:00
parent ff56bb2678
commit da2c3d86f5
9 changed files with 148 additions and 163 deletions

View file

@ -1,17 +1,14 @@
use std::fs::File;
use std::io::{BufWriter, Write};
use crate::vault::Vault;
use crate::vault::EuphRoomVault;
const CHUNK_SIZE: usize = 10000;
pub async fn export_to_file(
vault: &Vault,
room: String,
vault: &EuphRoomVault,
file: &mut BufWriter<File>,
) -> anyhow::Result<()> {
let vault = vault.euph(room);
write!(file, "[")?;
let mut total = 0;