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]

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 Send for ChatMap

impl Sync for ChatMap

impl Unpin for ChatMap

impl UnwindSafe for ChatMap

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,