pub async fn friendship_payload(&self, friendship_id: String) -> Result<FriendshipPayload, PuppetError> {
        debug!("friendship_payload(friendship_id = {})", friendship_id);
        let cache = &*self.cache_friendship_payload;
        if cache.lock().unwrap().contains(&friendship_id) {
            Ok(cache.lock().unwrap().get(&friendship_id).unwrap().clone())
        } else {
            match self.puppet_impl.friendship_raw_payload(friendship_id.clone()).await {
                Ok(payload) => {
                    cache.lock().unwrap().put(friendship_id.clone(), payload.clone());
                    Ok(payload)
                }
                Err(e) => Err(e),
            }
        }
    }
/// Load a friendship by id.
Load a friendship by id.
Load a friendship by id .
pub async fn friendship_payload(&self, friendship_id: String) -> Result<FriendshipPayload, PuppetError> {
        debug!("friendship_payload(friendship_id = {})", friendship_id);
        let cache = &*self.cache_friendship_payload;
        if cache.lock().unwrap().contains(&friendship_id) {
            Ok(cache.lock().unwrap().get(&friendship_id).unwrap().clone())
        } else {
            match self.puppet_impl.friendship_raw_payload(friendship_id.clone()).await {
                Ok(payload) => {
                    cache.lock().unwrap().put(friendship_id.clone(), payload.clone());
                    Ok(payload)
                }
                Err(e) => Err(e),
            }
        }
    }
pub async fn friendship_payload ( & self , friendship_id : String ) -> Result < FriendshipPayload , PuppetError > { debug ! ( " " friendship_id ) ; let cache = & * self . cache_friendship_payload ; if cache . lock ( ) . unwrap ( ) . contains ( & friendship_id ) { Ok ( cache . lock ( ) . unwrap ( ) . get ( & friendship_id ) . unwrap ( ) . clone ( ) ) } else { match self . puppet_impl . friendship_raw_payload ( friendship_id . clone ( ) ) . await { Ok ( payload ) => { cache . lock ( ) . unwrap ( ) . put ( friendship_id . clone ( ) , payload . clone ( ) ) ; Ok ( payload ) } Err ( e ) => Err ( e ) , } } }
Load a friendship by id.
Load a friendship by id .
&self
friendship_id
String
&self
friendship_id
String