Struct httptest::matchers::KV

source ·
pub struct KV<K, V>
where Self: Sized, K: ToOwned + ?Sized, V: ToOwned + ?Sized,
{ pub k: K::Owned, pub v: V::Owned, }
Expand description

A key-value pair.

Fields§

§k: K::Owned

The key

§v: V::Owned

The value

Implementations§

source§

impl<K, V> KV<K, V>
where K: ToOwned + ?Sized, V: ToOwned + ?Sized,

source

pub fn new(k: &K, v: &V) -> Self

Create a new KV. This will clone the provided k and v.

Trait Implementations§

source§

impl<K, V> Debug for KV<K, V>
where Self: Sized, K: ToOwned + ?Sized + Debug, V: ToOwned + ?Sized + Debug, K::Owned: Debug, V::Owned: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<K, V, KMatcher, VMatcher> Matcher<KV<K, V>> for (KMatcher, VMatcher)
where K: ToOwned + Debug + ?Sized, V: ToOwned + Debug + ?Sized, KMatcher: Matcher<K>, VMatcher: Matcher<V>,

source§

fn matches(&mut self, input: &KV<K, V>, ctx: &mut ExecutionContext) -> bool

Map an input to output.
source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

formatted name of the mapper. This is used for debugging purposes and should typically look like a fmt::Debug representation.
source§

impl<M, K, V> Matcher<KV<K, V>> for Key<M>
where K: ToOwned + Debug + ?Sized, V: ToOwned + ?Sized, M: Matcher<K>,

source§

fn matches(&mut self, input: &KV<K, V>, ctx: &mut ExecutionContext) -> bool

Map an input to output.
source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

formatted name of the mapper. This is used for debugging purposes and should typically look like a fmt::Debug representation.
source§

impl<M, K, V> Matcher<KV<K, V>> for Value<M>
where K: ToOwned + ?Sized, V: ToOwned + Debug + ?Sized, M: Matcher<V>,

source§

fn matches(&mut self, input: &KV<K, V>, ctx: &mut ExecutionContext) -> bool

Map an input to output.
source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

formatted name of the mapper. This is used for debugging purposes and should typically look like a fmt::Debug representation.
source§

impl<K, V> PartialEq for KV<K, V>
where Self: Sized, K: ToOwned + ?Sized + PartialEq, V: ToOwned + ?Sized + PartialEq, K::Owned: PartialEq, V::Owned: PartialEq,

source§

fn eq(&self, other: &KV<K, V>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<K, V> PartialOrd for KV<K, V>

source§

fn partial_cmp(&self, other: &KV<K, V>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<K, V> StructuralPartialEq for KV<K, V>
where Self: Sized, K: ToOwned + ?Sized, V: ToOwned + ?Sized,

Auto Trait Implementations§

§

impl<K: ?Sized, V: ?Sized> RefUnwindSafe for KV<K, V>

§

impl<K: ?Sized, V: ?Sized> Send for KV<K, V>
where <K as ToOwned>::Owned: Send, <V as ToOwned>::Owned: Send,

§

impl<K: ?Sized, V: ?Sized> Sync for KV<K, V>
where <K as ToOwned>::Owned: Sync, <V as ToOwned>::Owned: Sync,

§

impl<K: ?Sized, V: ?Sized> Unpin for KV<K, V>
where <K as ToOwned>::Owned: Unpin, <V as ToOwned>::Owned: Unpin,

§

impl<K: ?Sized, V: ?Sized> UnwindSafe for KV<K, V>
where <K as ToOwned>::Owned: UnwindSafe, <V as ToOwned>::Owned: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more