Struct QueryMut
pub struct QueryMut<'a> { /* private fields */ }net only.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§
§impl<'a> QueryMut<'a>
impl<'a> QueryMut<'a>
pub fn push_pair(
&mut self,
name: impl IntoUriComponent,
value: impl IntoUriComponent,
) -> &mut QueryMut<'a>
pub fn push_pair( &mut self, name: impl IntoUriComponent, value: impl IntoUriComponent, ) -> &mut QueryMut<'a>
Append a name=value pair. Both name and value are
percent-encoded under the pair policy (encode &, =, +,
%, and everything outside pchar).
pub fn push_key(&mut self, name: impl IntoUriComponent) -> &mut QueryMut<'a>
pub fn push_key(&mut self, name: impl IntoUriComponent) -> &mut QueryMut<'a>
Append a bare key (no =). Same encoding policy as
push_pair.
pub 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.
pub fn retain(
&mut self,
keep: impl FnMut(QueryPairRef<'_>) -> bool,
) -> &mut QueryMut<'a>
pub fn retain( &mut self, keep: impl FnMut(QueryPairRef<'_>) -> bool, ) -> &mut QueryMut<'a>
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.
pub 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.
pub fn set_pair(
&mut self,
name: impl IntoUriComponent,
value: impl IntoUriComponent,
) -> &mut QueryMut<'a>
pub fn set_pair( &mut self, name: impl IntoUriComponent, value: impl IntoUriComponent, ) -> &mut QueryMut<'a>
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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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 more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more