[][src]Struct seed::browser::url::UrlSearch

pub struct UrlSearch { /* fields omitted */ }

Implementations

impl UrlSearch[src]

pub fn new<K, V, VS>(params: impl IntoIterator<Item = (K, VS)>) -> Self where
    K: Into<String>,
    V: Into<String>,
    VS: IntoIterator<Item = V>, 
[src]

Makes a new UrlSearch with the provided parameters.

Examples

UrlSearch::new(vec![
    ("sort", vec!["date", "name"]),
    ("category", vec!["top"])
])

pub fn contains_key(&self, key: impl AsRef<str>) -> bool[src]

Returns true if the UrlSearch contains a value for the specified key.

pub fn get(&self, key: impl AsRef<str>) -> Option<&Vec<String>>[src]

Returns a reference to values corresponding to the key.

pub fn get_mut(&mut self, key: impl AsRef<str>) -> Option<&mut Vec<String>>[src]

Returns a mutable reference to values corresponding to the key.

pub fn push_value<'a>(&mut self, key: impl Into<Cow<'a, str>>, value: String)[src]

Push the value into the vector of values corresponding to the key.

  • If the key and values are not present, they will be crated.

pub fn insert(
    &mut self,
    key: String,
    values: Vec<String>
) -> Option<Vec<String>>
[src]

Inserts a key-values pair into the UrlSearch.

  • If the UrlSearch did not have this key present, None is returned.
  • If the UrlSearch did have this key present, old values are overwritten by new ones, and old values are returned. The key is not updated.

pub fn remove(&mut self, key: impl AsRef<str>) -> Option<Vec<String>>[src]

Removes a key from the UrlSearch, returning values at the key if the key was previously in the UrlSearch.

pub fn iter(&self) -> impl Iterator<Item = (&String, &Vec<String>)>[src]

Gets an iterator over the entries of the UrlSearch, sorted by key.

pub fn invalid_components(&self) -> &[String][src]

Get invalid components.

Undecodable / unparsable components are invalid.

pub fn invalid_components_mut(&mut self) -> &mut Vec<String>[src]

Get mutable invalid components.

Undecodable / unparsable components are invalid.

Trait Implementations

impl Clone for UrlSearch[src]

impl Debug for UrlSearch[src]

impl Default for UrlSearch[src]

impl<'de> Deserialize<'de> for UrlSearch[src]

impl Display for UrlSearch[src]

UrlSearch components are automatically encoded.

impl From<UrlSearchParams> for UrlSearch[src]

fn from(params: UrlSearchParams) -> Self[src]

Creates a new UrlSearch from the browser native UrlSearchParams. UrlSearch's components are decoded if possible. When decoding fails, the component is cloned into invalid_components and the original value is used.

impl PartialEq<UrlSearch> for UrlSearch[src]

impl Serialize for UrlSearch[src]

impl StructuralPartialEq for UrlSearch[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Sealed<T> for T where
    T: ?Sized

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,