pub struct QueryMut<'a> { /* private fields */ }Expand description
Mutable view of a Uri’s query component.
Pushes append to the existing query, auto-encoding bytes outside the
pair grammar. The first push promotes a None query to Some(empty)
(i.e. adds a ? to the wire form). Drop releases the borrow.
Implementations§
Source§impl<'a> QueryMut<'a>
impl<'a> QueryMut<'a>
Sourcepub fn push_pair(
&mut self,
name: impl IntoUriComponent,
value: impl IntoUriComponent,
) -> &mut Self
pub fn push_pair( &mut self, name: impl IntoUriComponent, value: impl IntoUriComponent, ) -> &mut Self
Append a name=value pair. Both name and value are
percent-encoded under the pair policy (encode &, =, +,
%, and everything outside pchar).
Sourcepub fn push_key(&mut self, name: impl IntoUriComponent) -> &mut Self
pub fn push_key(&mut self, name: impl IntoUriComponent) -> &mut Self
Append a bare key (no =). Same encoding policy as
push_pair.
Sourcepub fn drain(&mut self) -> Drain ⓘ
pub fn drain(&mut self) -> Drain ⓘ
Empty the query content and return an iterator yielding the
removed pairs as owned QueryPairs.
The query stays Some(empty) after this — the ? remains on
the wire. Call Uri::unset_query to
remove the ? entirely.
Sourcepub fn retain(
&mut self,
keep: impl FnMut(QueryPairRef<'_>) -> bool,
) -> &mut Self
pub fn retain( &mut self, keep: impl FnMut(QueryPairRef<'_>) -> bool, ) -> &mut Self
Keep only the pairs for which keep returns true, preserving
their order and raw bytes. Empty &-fragments (&&, leading /
trailing &) are dropped as part of the rebuild.
Like drain, the query stays Some(_) (the ?
remains on the wire) even when every pair is removed.
Sourcepub fn remove(&mut self, name: impl IntoUriComponent) -> usize
pub fn remove(&mut self, name: impl IntoUriComponent) -> usize
Remove every pair whose form-decoded name equals name (bare keys
included). Returns the number of pairs removed.
name is component text, compared form-decoded on both sides —
see QueryRef::first_value for the
matching rules.
Sourcepub fn set_pair(
&mut self,
name: impl IntoUriComponent,
value: impl IntoUriComponent,
) -> &mut Self
pub fn set_pair( &mut self, name: impl IntoUriComponent, value: impl IntoUriComponent, ) -> &mut Self
Trait Implementations§
Auto Trait Implementations§
impl<'a> !UnwindSafe for QueryMut<'a>
impl<'a> Freeze for QueryMut<'a>
impl<'a> RefUnwindSafe for QueryMut<'a>
impl<'a> Send for QueryMut<'a>
impl<'a> Sync for QueryMut<'a>
impl<'a> Unpin for QueryMut<'a>
impl<'a> UnsafeUnpin for QueryMut<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
Source§impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
type Error = <U as RamaTryFrom<T, CrateMarker>>::Error
fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T, CrateMarker>>::Error>
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<V, F> ValueFormatter<&V> for F
impl<V, F> ValueFormatter<&V> for F
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
metrique_require_explicit_impls only.Source§fn format_value(writer: impl ValueWriter, value: &&V)
fn format_value(writer: impl ValueWriter, value: &&V)
value to writerSource§impl<V, F> ValueFormatter<Arc<V>> for F
impl<V, F> ValueFormatter<Arc<V>> for F
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
metrique_require_explicit_impls only.Source§fn format_value(writer: impl ValueWriter, value: &Arc<V>)
fn format_value(writer: impl ValueWriter, value: &Arc<V>)
value to writerSource§impl<V, F> ValueFormatter<Box<V>> for F
impl<V, F> ValueFormatter<Box<V>> for F
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
metrique_require_explicit_impls only.Source§fn format_value(writer: impl ValueWriter, value: &Box<V>)
fn format_value(writer: impl ValueWriter, value: &Box<V>)
value to writerSource§impl<V, F> ValueFormatter<Cow<'_, V>> for F
impl<V, F> ValueFormatter<Cow<'_, V>> for F
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
metrique_require_explicit_impls only.Source§fn format_value(writer: impl ValueWriter, value: &Cow<'_, V>)
fn format_value(writer: impl ValueWriter, value: &Cow<'_, V>)
value to writerSource§impl<V, F> ValueFormatter<Option<V>> for Fwhere
F: ValueFormatter<V> + ?Sized,
impl<V, F> ValueFormatter<Option<V>> for Fwhere
F: ValueFormatter<V> + ?Sized,
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
metrique_require_explicit_impls only.Source§fn format_value(writer: impl ValueWriter, value: &Option<V>)
fn format_value(writer: impl ValueWriter, value: &Option<V>)
value to writer