use std::path::Path;
use crate::http::cookie::CookieStorage;
use super::types::SessionPersistence;
impl SessionPersistence {
pub(super) async fn save_cookie_storage_to_file(
storage: &CookieStorage,
path: &Path,
) -> Result<(), String> {
storage.save_file(path).map_err(|e| e.to_string())
}
pub(super) async fn load_cookie_storage_from_file(
storage: &CookieStorage,
path: &Path,
) -> Result<(), String> {
storage
.load_file(path)
.map(|_| ())
.map_err(|e| e.to_string())
}
}