//! Open post body use super::*; use tokio::{ sync::{ watch, mpsc, }, }; use once_cell::sync::OnceCell; /// An open post body #[derive(Debug)] pub struct Karada { scape: Vec, body_cache: String, //TODO: Pub/sub? Or should that be in some other place? Probably. } impl Karada { fn invalidate_cache(&mut self) { self.body_cache = self.scape.iter().copied().collect(); } /// Apply this delta to the body. pub fn apply_delta(&mut self, delta: &delta::Delta) { delta.insert(&mut self.scape); self.invalidate_cache(); } }