pub async fn room_payload(&self, room_id: String) -> Result<RoomPayload, PuppetError> {
        debug!("room_payload(room_id = {})", room_id);
        let cache = &*self.cache_room_payload;
        if cache.lock().unwrap().contains(&room_id) {
            Ok(cache.lock().unwrap().get(&room_id).unwrap().clone())
        } else {
            match self.puppet_impl.room_raw_payload(room_id.clone()).await {
                Ok(payload) => {
                    cache.lock().unwrap().put(room_id.clone(), payload.clone());
                    Ok(payload)
                }
                Err(e) => Err(e),
            }
        }
    }
/// Load a room by id.
Load a room by id.
Load a room by id .
pub async fn room_payload(&self, room_id: String) -> Result<RoomPayload, PuppetError> {
        debug!("room_payload(room_id = {})", room_id);
        let cache = &*self.cache_room_payload;
        if cache.lock().unwrap().contains(&room_id) {
            Ok(cache.lock().unwrap().get(&room_id).unwrap().clone())
        } else {
            match self.puppet_impl.room_raw_payload(room_id.clone()).await {
                Ok(payload) => {
                    cache.lock().unwrap().put(room_id.clone(), payload.clone());
                    Ok(payload)
                }
                Err(e) => Err(e),
            }
        }
    }
pub async fn room_payload ( & self , room_id : String ) -> Result < RoomPayload , PuppetError > { debug ! ( " " room_id ) ; let cache = & * self . cache_room_payload ; if cache . lock ( ) . unwrap ( ) . contains ( & room_id ) { Ok ( cache . lock ( ) . unwrap ( ) . get ( & room_id ) . unwrap ( ) . clone ( ) ) } else { match self . puppet_impl . room_raw_payload ( room_id . clone ( ) ) . await { Ok ( payload ) => { cache . lock ( ) . unwrap ( ) . put ( room_id . clone ( ) , payload . clone ( ) ) ; Ok ( payload ) } Err ( e ) => Err ( e ) , } } }
Load a room by id.
Load a room by id .
&self
room_id
String
&self
room_id
String