pub async fn room_member_payload(
        &self,
        room_id: String,
        member_id: String,
    ) -> Result<RoomMemberPayload, PuppetError> {
        debug!("room_member_payload(room_id = {}, member_id = {})", room_id, member_id);
        let cache_key = Puppet::<T>::cache_key_room_member(room_id.clone(), member_id.clone());
        let cache = &*self.cache_room_member_payload;
        if cache.lock().unwrap().contains(&cache_key) {
            Ok(cache.lock().unwrap().get(&cache_key).unwrap().clone())
        } else {
            match self
                .puppet_impl
                .room_member_raw_payload(room_id.clone(), member_id.clone())
                .await
            {
                Ok(payload) => {
                    cache.lock().unwrap().put(cache_key, payload.clone());
                    Ok(payload)
                }
                Err(e) => Err(e),
            }
        }
    }
/// Load a room member by room id and payload id.
Load a room member by room id and payload id.
Load a room member by room id and payload id .
pub async fn room_member_payload(
        &self,
        room_id: String,
        member_id: String,
    ) -> Result<RoomMemberPayload, PuppetError> {
        debug!("room_member_payload(room_id = {}, member_id = {})", room_id, member_id);
        let cache_key = Puppet::<T>::cache_key_room_member(room_id.clone(), member_id.clone());
        let cache = &*self.cache_room_member_payload;
        if cache.lock().unwrap().contains(&cache_key) {
            Ok(cache.lock().unwrap().get(&cache_key).unwrap().clone())
        } else {
            match self
                .puppet_impl
                .room_member_raw_payload(room_id.clone(), member_id.clone())
                .await
            {
                Ok(payload) => {
                    cache.lock().unwrap().put(cache_key, payload.clone());
                    Ok(payload)
                }
                Err(e) => Err(e),
            }
        }
    }
pub async fn room_member_payload ( & self , room_id : String , member_id : String , ) -> Result < RoomMemberPayload , PuppetError > { debug ! ( " " room_id member_id ) ; let cache_key = Puppet :: < T > :: cache_key_room_member ( room_id . clone ( ) , member_id . clone ( ) ) ; let cache = & * self . cache_room_member_payload ; if cache . lock ( ) . unwrap ( ) . contains ( & cache_key ) { Ok ( cache . lock ( ) . unwrap ( ) . get ( & cache_key ) . unwrap ( ) . clone ( ) ) } else { match self . puppet_impl . room_member_raw_payload ( room_id . clone ( ) , member_id . clone ( ) ) . await { Ok ( payload ) => { cache . lock ( ) . unwrap ( ) . put ( cache_key , payload . clone ( ) ) ; Ok ( payload ) } Err ( e ) => Err ( e ) , } } }
Load a room member by room id and payload id.
Load a room member by room id and payload id .
&self
room_id
String
member_id
String
&self
room_id
String
member_id
String