pub async fn entries<'s, D>(&'s self, word_id: &'s str, params: &'s [Param<'s>]) -> Result<D>
    where
        D: serde::de::DeserializeOwned,
    {
        use std::io::Write;
        trace!("request to entries api");
        if !self.source_language.entries_api() {
            error!("lang {} doesn't support Entries API", self.source_language);
            return Err(Error::UnsupportedApi {
                lang: self.source_language,
                api: "entries".to_owned(),
            });
        }

        let endpoint = Endpoint::Entries.as_str();
        let mut path = Vec::with_capacity(
            endpoint.len() + self.source_language.code().len() + word_id.len() + 64,
        );
        write!(
            &mut path,
            "{}/{}/{}",
            Endpoint::Entries.as_str(),
            self.source_language.code(),
            word_id
        )
        .unwrap();
        write!(&mut path, "?").unwrap();
        for (i, q) in params.iter().enumerate() {
            serde_qs::to_writer(q, &mut path).unwrap();
            if i != params.len() - 1 {
                write!(&mut path, "&").unwrap();
            }
        }
        let mut resp = self
            .get_request(std::str::from_utf8(&path).unwrap())
            .send()
            .await?;
        Client::handle_api_error(&mut resp).await?;
        Ok(resp.body_json().await?)
    }
/// Request definitions, pronunciations, example sentences,
/// grammatical information, word origins.
/// ## Arguments
/// `word_id` - should be dictionary headword (e.g. crab, not crabs)
/// ## Misuse
/// You should not duplicate [`Param`](Param) in this
/// function call
Request definitions, pronunciations, example sentences,
grammatical information, word origins.
Request definitions pronunciations example sentences grammatical information word origins .
pub async fn entries<'s, D>(&'s self, word_id: &'s str, params: &'s [Param<'s>]) -> Result<D>
    where
        D: serde::de::DeserializeOwned,
    {
        use std::io::Write;
        trace!("request to entries api");
        if !self.source_language.entries_api() {
            error!("lang {} doesn't support Entries API", self.source_language);
            return Err(Error::UnsupportedApi {
                lang: self.source_language,
                api: "entries".to_owned(),
            });
        }
        let endpoint = Endpoint::Entries.as_str();
        let mut path = Vec::with_capacity(
            endpoint.len() + self.source_language.code().len() + word_id.len() + 64,
        );
        write!(
            &mut path,
            "{}/{}/{}",
            Endpoint::Entries.as_str(),
            self.source_language.code(),
            word_id
        )
        .unwrap();
        write!(&mut path, "?").unwrap();
        for (i, q) in params.iter().enumerate() {
            serde_qs::to_writer(q, &mut path).unwrap();
            if i != params.len() - 1 {
                write!(&mut path, "&").unwrap();
            }
        }
        let mut resp = self
            .get_request(std::str::from_utf8(&path).unwrap())
            .send()
            .await?;
        Client::handle_api_error(&mut resp).await?;
        Ok(resp.body_json().await?)
    }
pub async fn entries < ' s , D > ( & ' s self , word_id : & ' s str , params : & ' s [ Param < ' s > ] ) -> Result < D > where D : serde :: de :: DeserializeOwned , { use std :: io :: Write ; trace ! ( " " ) ; if ! self . source_language . entries_api ( ) { error ! ( " " self source_language ) ; return Err ( Error :: UnsupportedApi { lang : self . source_language , api : " " . to_owned ( ) , } ) ; } let endpoint = Endpoint :: Entries . as_str ( ) ; let mut path = Vec :: with_capacity ( endpoint . len ( ) + self . source_language . code ( ) . len ( ) + word_id . len ( ) + 64 , ) ; write ! ( mut path " " Endpoint Entries as_str ( ) self source_language code ( ) word_id ) . unwrap ( ) ; write ! ( mut path " " ) . unwrap ( ) ; for ( i , q ) in params . iter ( ) . enumerate ( ) { serde_qs :: to_writer ( q , & mut path ) . unwrap ( ) ; if i != params . len ( ) - 1 { write ! ( mut path " " ) . unwrap ( ) ; } } let mut resp = self . get_request ( std :: str :: from_utf8 ( & path ) . unwrap ( ) ) . send ( ) . await ? ; Client :: handle_api_error ( & mut resp ) . await ? ; Ok ( resp . body_json ( ) . await ? ) }
Request definitions, pronunciations, example sentences,
grammatical information, word origins.
Request definitions pronunciations example sentences grammatical information word origins .
&'s self
word_id
&'s str
params
&'s [Param<'s>]
misuse
You should not duplicate [`Param`](Param) in this
function call
You should not duplicate [ ` Param ` ] ( Param ) in this function call