//! # Posts targets //! //! @author Pierre Hubert use serde::Serialize; use crate::data::group_id::GroupID; use crate::data::user::UserID; #[derive(Serialize)] pub struct PostsTargets { friends: Vec, groups: Vec, } impl PostsTargets { pub fn new(f: &Vec, g: &Vec) -> PostsTargets { PostsTargets { friends: f.iter().map(|f| f.id()).collect(), groups: g.iter().map(|f| f.id()).collect(), } } }