use std::path::PathBuf;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ProfileSnapshot {
pub kind: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub path: Option<PathBuf>,
#[serde(default, skip_serializing_if = "std::ops::Not::not")]
pub locked: bool,
}
impl ProfileSnapshot {
#[must_use]
pub fn is_persistent(&self) -> bool {
self.kind == "persistent"
}
#[must_use]
pub fn canonical_cookie_jar(&self) -> Option<PathBuf> {
self.path.as_ref().map(|p| p.join("cookies.jar.json"))
}
}