use crate::Object; pub const PUBLIC : &str = "https://www.w3.org/ns/activitystreams#Public"; pub trait Addressed { fn addressed(&self) -> Vec; // TODO rename this? remate others? idk fn primary_targets(&self) -> Vec; fn secondary_targets(&self) -> Vec; fn public_targets(&self) -> Vec; fn private_targets(&self) -> Vec; } impl Addressed for T { fn addressed(&self) -> Vec { let mut to : Vec = self.to().ids(); to.append(&mut self.bto().ids()); to.append(&mut self.cc().ids()); to.append(&mut self.bcc().ids()); to } fn primary_targets(&self) -> Vec { let mut to : Vec = self.to().ids(); to.append(&mut self.bto().ids()); to } fn secondary_targets(&self) -> Vec { let mut to : Vec = self.cc().ids(); to.append(&mut self.bcc().ids()); to } fn public_targets(&self) -> Vec { let mut to : Vec = self.to().ids(); to.append(&mut self.cc().ids()); to } fn private_targets(&self) -> Vec { let mut to : Vec = self.bto().ids(); to.append(&mut self.bcc().ids()); to } }