pub enum Match {
Any,
PrimaryContains(String),
PrimaryIs(String),
BodyContains(String),
JsonEq {
pointer: String,
value: Value,
},
All(Vec<Match>),
AnyOf(Vec<Match>),
}Expand description
A filter over an outgoing request. primary is the URL (HTTP) or the method (RPC); body is
the request body (HTTP) or the params (RPC). Compose with Match::all / Match::any_of.
Variants§
Any
Matches anything.
PrimaryContains(String)
primary contains this substring (URL substring, or partial method).
PrimaryIs(String)
primary equals this exactly (e.g. an RPC method name).
BodyContains(String)
The body contains this substring (e.g. a GraphQL field name).
JsonEq
The body parses as JSON and the value at pointer equals value.
Fields
All(Vec<Match>)
All of the inner matches hold.
AnyOf(Vec<Match>)
At least one of the inner matches holds.
Implementations§
Source§impl Match
impl Match
Sourcepub fn primary_contains(s: impl Into<String>) -> Match
pub fn primary_contains(s: impl Into<String>) -> Match
primary contains s.
Sourcepub fn body_contains(s: impl Into<String>) -> Match
pub fn body_contains(s: impl Into<String>) -> Match
Body contains s.
Sourcepub fn json_eq(pointer: impl Into<String>, value: Value) -> Match
pub fn json_eq(pointer: impl Into<String>, value: Value) -> Match
Body JSON at pointer equals value.
Sourcepub fn all(m: impl IntoIterator<Item = Match>) -> Match
pub fn all(m: impl IntoIterator<Item = Match>) -> Match
All must hold.
Sourcepub fn any_of(m: impl IntoIterator<Item = Match>) -> Match
pub fn any_of(m: impl IntoIterator<Item = Match>) -> Match
Any may hold.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Match
impl RefUnwindSafe for Match
impl Send for Match
impl Sync for Match
impl Unpin for Match
impl UnsafeUnpin for Match
impl UnwindSafe for Match
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