Struct grammers_client::types::chat_map::ChatMap [−][src]
pub struct ChatMap { /* fields omitted */ }Helper structure to efficiently retrieve chats via their peer.
A lot of responses include the chats related to them in the form of a list of users
and chats, making it annoying to extract a specific chat. This structure lets you
save those separate vectors in a single place and query them by using a Peer.
Implementations
impl ChatMap[src]
impl ChatMap[src]pub fn new(users: Vec<User>, chats: Vec<Chat>) -> Arc<Self>[src]
Create a new chat set.
pub fn empty() -> Arc<Self>[src]
Create a new empty chat set.
pub fn single(chat: &Chat) -> Arc<Self>[src]
pub fn get<'a, 'b>(&'a self, peer: &'b Peer) -> Option<&'a Chat>[src]
Retrieve the full Chat object given its Peer.
pub fn remove(&mut self, peer: &Peer) -> Option<Chat>[src]
Take the full Chat object given its Peer and remove it from the map.
Auto Trait Implementations
impl RefUnwindSafe for ChatMap
impl RefUnwindSafe for ChatMapimpl UnwindSafe for ChatMap
impl UnwindSafe for ChatMap