better-url 0.12.0

A better URL crate.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Setters.

use crate::prelude::*;

impl Query<'_> {
    /// Either [`SpecialQuery::set`] or, [`NonSpecialQuery::set`].
    /// # Errors
    /// If [`SpecialQuery::set`] returns an error, that error is returned.
    ///
    /// If [`NonSpecialQuery::set`] returns an error, that error is returned.
    pub fn set<'b, N: AsRef<[u8]>, T: Into<MaybeSpecialQueryValue<'b>> + Into<MaybeNonSpecialQueryValue<'b>>>(&mut self, name: N, index: isize, value: Option<T>) -> Result<bool, SetQueryError> {
        match self {
            Self::Special   (x) => x.set(name, index, value),
            Self::NonSpecial(x) => x.set(name, index, value),
        }
    }
}