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<'a> MaybeQuery<'a> {
    /// Either [`MaybeSpecialQuery::set`] or [`MaybeNonSpecialQuery::set`].
    /// # Errors
    /// If [`MaybeSpecialQuery::set`] returns an error, that error is returned.
    ///
    /// If [`MaybeNonSpecialQuery::set`] returns an error, that error is returned.
    pub fn set<'b, T: Into<MaybeSpecialQueryValue<'b>> + Into<MaybeNonSpecialQueryValue<'b>>>(&mut self, name: &str, 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),
        }
    }
}