pub fn tags_frequency(&self) -> Result<Vec<Tag>, Error> {
        // Pinboard API returns jsonn array when user has no tags, otherwise it returns an
        // object/map of tag:frequency!
        debug!("tags_frequency: starting.");
        let res =
            self.get_api_response([BASE_URL, "/tags/get"].concat().as_str(), HashMap::new())?;
        let raw_tags = serde_json::from_str::<HashMap<String, usize>>(&res);
        match raw_tags {
            Ok(res) => Ok(res
                .into_iter()
                .map(|(k, freq)| {
                    Tag::new(k, freq)
                })
                .collect()),
            Err(_) => {
                debug!("  trying to decode non-object empty tag list");
                let raw_tags = serde_json::from_str::<Vec<HashMap<String, String>>>(&res)?;
                assert!(raw_tags.is_empty());
                Ok(vec![])
            }
        }
    }
/// Gets all tags with their usage frequency.
Gets all tags with their usage frequency.
Gets all tags with their usage frequency .
pub fn tags_frequency(&self) -> Result<Vec<Tag>, Error> {
        // Pinboard API returns jsonn array when user has no tags, otherwise it returns an
        // object/map of tag:frequency!
        debug!("tags_frequency: starting.");
        let res =
            self.get_api_response([BASE_URL, "/tags/get"].concat().as_str(), HashMap::new())?;
        let raw_tags = serde_json::from_str::<HashMap<String, usize>>(&res);
        match raw_tags {
            Ok(res) => Ok(res
                .into_iter()
                .map(|(k, freq)| {
                    Tag::new(k, freq)
                })
                .collect()),
            Err(_) => {
                debug!("  trying to decode non-object empty tag list");
                let raw_tags = serde_json::from_str::<Vec<HashMap<String, String>>>(&res)?;
                assert!(raw_tags.is_empty());
                Ok(vec![])
            }
        }
    }
pub fn tags_frequency ( & self ) -> Result < Vec < Tag > , Error > { // Pinboard API returns jsonn array when user has no tags, otherwise it returns an // object/map of tag:frequency! debug ! ( " " ) ; let res = self . get_api_response ( [ BASE_URL , " " ] . concat ( ) . as_str ( ) , HashMap :: new ( ) ) ? ; let raw_tags = serde_json :: from_str :: < HashMap < String , usize > > ( & res ) ; match raw_tags { Ok ( res ) => Ok ( res . into_iter ( ) . map ( | ( k , freq ) | { Tag :: new ( k , freq ) } ) . collect ( ) ) , Err ( _ ) => { debug ! ( " " ) ; let raw_tags = serde_json :: from_str :: < Vec < HashMap < String , String > > > ( & res ) ? ; assert ! ( raw_tags is_empty ( ) ) ; Ok ( vec ! [ ] ) } } }
Gets all tags with their usage frequency.
Gets all tags with their usage frequency .
&self
&self