pub struct GrpcOverride {
pub service: String,
pub method: String,
pub match: HashMap<String, String>,
pub response: GrpcOverrideResponse,
}Expand description
A single per-method override rule for the gRPC mock.
Use this to return specific status codes or response bodies from a method
without modifying the proto file. Rules are evaluated in declaration order;
the first one whose service+method (and optional match) match the
incoming request wins. Unmatched calls fall back to the default
smart-mock-generation behavior.
Fields§
§service: StringFully-qualified service name without leading dot, e.g. myapp.OrderService.
May also be the unqualified service name; matching is exact.
method: StringMethod name (case-sensitive, matches proto definition).
match: HashMap<String, String>Optional request-field-equality match. Keys are top-level field names of the request message; values are stringified expected values. When omitted, the rule matches every call to the named method.
response: GrpcOverrideResponseResponse to return when this rule fires.
Trait Implementations§
Source§impl Clone for GrpcOverride
impl Clone for GrpcOverride
Source§fn clone(&self) -> GrpcOverride
fn clone(&self) -> GrpcOverride
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GrpcOverride
impl Debug for GrpcOverride
Source§impl<'de> Deserialize<'de> for GrpcOverride
impl<'de> Deserialize<'de> for GrpcOverride
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for GrpcOverride
impl JsonSchema for GrpcOverride
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for GrpcOverride
impl RefUnwindSafe for GrpcOverride
impl Send for GrpcOverride
impl Sync for GrpcOverride
impl Unpin for GrpcOverride
impl UnsafeUnpin for GrpcOverride
impl UnwindSafe for GrpcOverride
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more