pub struct URLSearchParams { /* private fields */ }Expand description
URLSearchParams: Parsing, manipulating, and serializing URL query parameters.
Implementations§
Source§impl URLSearchParams
impl URLSearchParams
Sourcepub fn get(&self, name: &str) -> Option<&str>
pub fn get(&self, name: &str) -> Option<&str>
Returns the first value associated with the given search parameter.
Sourcepub fn get_all(&self, name: &str) -> Vec<&str>
pub fn get_all(&self, name: &str) -> Vec<&str>
Returns all values associated with the given search parameter.
Sourcepub fn append(&mut self, name: impl Into<String>, value: impl Into<String>)
pub fn append(&mut self, name: impl Into<String>, value: impl Into<String>)
Appends a new name-value pair.
Sourcepub fn set(&mut self, name: impl Into<String>, value: impl Into<String>)
pub fn set(&mut self, name: impl Into<String>, value: impl Into<String>)
Sets the value associated with a given name, replacing all existing pairs with that name.
Sourcepub fn to_query_string(&self) -> String
pub fn to_query_string(&self) -> String
Serializes parameters back into standard application/x-www-form-urlencoded query string.
Trait Implementations§
Source§impl Clone for URLSearchParams
impl Clone for URLSearchParams
Source§impl Debug for URLSearchParams
impl Debug for URLSearchParams
Source§impl Default for URLSearchParams
impl Default for URLSearchParams
Source§impl PartialEq for URLSearchParams
impl PartialEq for URLSearchParams
impl StructuralPartialEq for URLSearchParams
Auto Trait Implementations§
impl Forget for URLSearchParams
impl Freeze for URLSearchParams
impl Move for URLSearchParams
impl RefUnwindSafe for URLSearchParams
impl Send for URLSearchParams
impl Sync for URLSearchParams
impl Unpin for URLSearchParams
impl UnsafeUnpin for URLSearchParams
impl UnwindSafe for URLSearchParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more