fn add(&mut self, name: Ident<'_>, value: impl fmt::Display) -> Result<()> {
        if self.get(name).is_some() {
            return Err(Error::ParamNameDuplicated);
        }

        let orig_len = self.0.length;

        if !self.is_empty() {
            self.0
                .write_char(PARAMS_DELIMITER)
                .map_err(|_| Error::ParamsMaxExceeded)?
        }

        if write!(self.0, "{}={}", name, value).is_err() {
            self.0.length = orig_len;
            return Err(Error::ParamsMaxExceeded);
        }

        Ok(())
    }
/// Add a value to this [`ParamsString`] using the provided callback.
Add a value to this [`ParamsString`] using the provided callback.
Add a value to this [ ` ParamsString ` ] using the provided callback .
fn add(&mut self, name: Ident<'_>, value: impl fmt::Display) -> Result<()> {
        if self.get(name).is_some() {
            return Err(Error::ParamNameDuplicated);
        }
        let orig_len = self.0.length;
        if !self.is_empty() {
            self.0
                .write_char(PARAMS_DELIMITER)
                .map_err(|_| Error::ParamsMaxExceeded)?
        }
        if write!(self.0, "{}={}", name, value).is_err() {
            self.0.length = orig_len;
            return Err(Error::ParamsMaxExceeded);
        }
        Ok(())
    }
fn add ( & mut self , name : Ident < ' _ > , value : impl fmt :: Display ) -> Result < ( ) > { if self . get ( name ) . is_some ( ) { return Err ( Error :: ParamNameDuplicated ) ; } let orig_len = self . 0 . length ; if ! self . is_empty ( ) { self . 0 . write_char ( PARAMS_DELIMITER ) . map_err ( | _ | Error :: ParamsMaxExceeded ) ? } if write ! ( self 0 " " name value ) . is_err ( ) { self . 0 . length = orig_len ; return Err ( Error :: ParamsMaxExceeded ) ; } Ok ( ( ) ) }
Add a value to this [`ParamsString`] using the provided callback.
Add a value to this [ ` ParamsString ` ] using the provided callback .
&mut self
name
Ident<'_>
value
impl fmt::Display
&mut self
name
Ident<'_>
value
impl fmt::Display