pub async fn message_payload(&self, message_id: String) -> Result<MessagePayload, PuppetError> {
        debug!("message_payload(message_id = {})", message_id);
        let cache = &*self.cache_message_payload;
        if cache.lock().unwrap().contains(&message_id) {
            Ok(cache.lock().unwrap().get(&message_id).unwrap().clone())
        } else {
            match self.puppet_impl.message_raw_payload(message_id.clone()).await {
                Ok(payload) => {
                    cache.lock().unwrap().put(message_id.clone(), payload.clone());
                    Ok(payload)
                }
                Err(e) => Err(e),
            }
        }
    }
/// Load a message by id.
Load a message by id.
Load a message by id .
pub async fn message_payload(&self, message_id: String) -> Result<MessagePayload, PuppetError> {
        debug!("message_payload(message_id = {})", message_id);
        let cache = &*self.cache_message_payload;
        if cache.lock().unwrap().contains(&message_id) {
            Ok(cache.lock().unwrap().get(&message_id).unwrap().clone())
        } else {
            match self.puppet_impl.message_raw_payload(message_id.clone()).await {
                Ok(payload) => {
                    cache.lock().unwrap().put(message_id.clone(), payload.clone());
                    Ok(payload)
                }
                Err(e) => Err(e),
            }
        }
    }
pub async fn message_payload ( & self , message_id : String ) -> Result < MessagePayload , PuppetError > { debug ! ( " " message_id ) ; let cache = & * self . cache_message_payload ; if cache . lock ( ) . unwrap ( ) . contains ( & message_id ) { Ok ( cache . lock ( ) . unwrap ( ) . get ( & message_id ) . unwrap ( ) . clone ( ) ) } else { match self . puppet_impl . message_raw_payload ( message_id . clone ( ) ) . await { Ok ( payload ) => { cache . lock ( ) . unwrap ( ) . put ( message_id . clone ( ) , payload . clone ( ) ) ; Ok ( payload ) } Err ( e ) => Err ( e ) , } } }
Load a message by id.
Load a message by id .
&self
message_id
String
&self
message_id
String