relentless_grpc::client

Struct GrpcMethodRequest

Source
pub struct GrpcMethodRequest<D, S> {
    pub destination: Uri,
    pub service: ServiceDescriptor,
    pub method: MethodDescriptor,
    pub codec: MethodCodec<D, S>,
    pub message: D,
}

Fields§

§destination: Uri§service: ServiceDescriptor§method: MethodDescriptor§codec: MethodCodec<D, S>§message: D

Implementations§

Source§

impl<D, S> GrpcMethodRequest<D, S>

Source

pub fn format_method_path(&self) -> PathAndQuery

Trait Implementations§

Source§

impl Assault<GrpcMethodRequest<Value, JsonSerializer>, Response<Value>> for GrpcAssault

Source§

type Request = GrpcRequest

Source§

type Response = GrpcResponse

Source§

type Recorder = GrpcIoRecorder

Source§

fn command(&self) -> &Relentless

Source§

fn recorder(&self) -> Self::Recorder

§

async fn execute<S>(&self, service: S) -> Result<ExitCode, RelentlessError>
where Self::Request: RequestFactory<Req, S>, <Self::Request as RequestFactory<Req, S>>::Error: Error + Send + Sync + 'static, <Self::Response as Evaluate<Res>>::Message: Display, S: Service<Req, Response = Res> + Clone + Send + 'static, <S as Service<Req>>::Error: Error + Send + Sync + 'static, <S as Service<Req>>::Future: Send + 'static,

§

fn configs( &self, ) -> (Vec<Config<Self::Request, Self::Response>>, Vec<RelentlessError>)

TODO document
§

fn all_destinations( &self, configs: &[Config<Self::Request, Self::Response>], ) -> Vec<Uri>

§

fn build_service<S>(&self, service: S) -> RecordService<S, Self::Recorder>
where Self::Recorder: IoRecord<Req> + CollectClone<Req> + RequestIoRecord<Req> + IoRecord<Res> + CollectClone<Res> + Clone + Send + 'static, S: Service<Req>,

TODO document
§

async fn assault_with<S>( &self, configs: Vec<Config<Self::Request, Self::Response>>, service: S, ) -> Result<Report<<Self::Response as Evaluate<Res>>::Message, Self::Request, Self::Response>, RelentlessError>
where Self::Request: RequestFactory<Req, S>, <Self::Request as RequestFactory<Req, S>>::Error: Error + Send + Sync + 'static, S: Service<Req, Response = Res> + Clone + Send + 'static, <S as Service<Req>>::Error: Error + Send + Sync + 'static, <S as Service<Req>>::Future: Send + 'static,

§

fn report_with<W>( &self, report: &Report<<Self::Response as Evaluate<Res>>::Message, Self::Request, Self::Response>, write: W, ) -> Result<bool, Error>
where <Self::Response as Evaluate<Res>>::Message: Display, W: Write,

§

fn pass( &self, report: &Report<<Self::Response as Evaluate<Res>>::Message, Self::Request, Self::Response>, ) -> bool

§

fn allow( &self, report: &Report<<Self::Response as Evaluate<Res>>::Message, Self::Request, Self::Response>, ) -> bool

§

fn exit_code( &self, report: &Report<<Self::Response as Evaluate<Res>>::Message, Self::Request, Self::Response>, ) -> ExitCode

Source§

impl<D: Clone, S: Clone> Clone for GrpcMethodRequest<D, S>

Source§

fn clone(&self) -> GrpcMethodRequest<D, S>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<De, Se> CollectClone<GrpcMethodRequest<De, Se>> for GrpcIoRecorder
where De: for<'a> Deserializer<'a> + DeserializeOwned + Send + Sync + 'static, for<'a> <De as Deserializer<'a>>::Error: Error + Send + Sync + 'static, Se: Clone + Send,

Source§

type Error = Error

Source§

async fn collect_clone( &self, r: GrpcMethodRequest<De, Se>, ) -> Result<(GrpcMethodRequest<De, Se>, GrpcMethodRequest<De, Se>), Self::Error>

Source§

impl<D: Debug, S: Debug> Debug for GrpcMethodRequest<D, S>

Source§

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

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

impl<De, Se> IoRecord<GrpcMethodRequest<De, Se>> for GrpcIoRecorder
where De: for<'a> Deserializer<'a> + Send + Sync + 'static, for<'a> <De as Deserializer<'a>>::Error: Error + Send + Sync + 'static, Se: Send,

Source§

type Error = Error

Source§

fn extension(&self, _r: &GrpcMethodRequest<De, Se>) -> &'static str

Source§

async fn record<W: Write>( &self, w: &mut W, r: GrpcMethodRequest<De, Se>, ) -> Result<(), Self::Error>

Source§

async fn record_raw<W: Write + Send>( &self, w: &mut W, r: GrpcMethodRequest<De, Se>, ) -> Result<(), Self::Error>

Source§

impl<D: PartialEq, S: PartialEq> PartialEq for GrpcMethodRequest<D, S>

Source§

fn eq(&self, other: &GrpcMethodRequest<D, S>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<S> RequestFactory<GrpcMethodRequest<Value, JsonSerializer>, S> for GrpcRequest

Source§

type Error = RelentlessError

Source§

async fn produce( &self, service: S, destination: &Uri, target: &str, template: &Template, ) -> Result<GrpcMethodRequest<Value, JsonSerializer>, Self::Error>

Source§

impl<De, Se> RequestIoRecord<GrpcMethodRequest<De, Se>> for GrpcIoRecorder

Source§

fn record_dir(&self, r: &GrpcMethodRequest<De, Se>) -> PathBuf

Source§

impl<S, De, Se> Service<GrpcMethodRequest<De, Se>> for GrpcClient<S>
where S: GrpcService<BoxBody> + Clone + Send + 'static, S::ResponseBody: Send, <S::ResponseBody as Body>::Error: Into<Box<dyn Error + Send + Sync>>, S::Future: Send + 'static, De: for<'a> Deserializer<'a> + Send + Sync + 'static, for<'a> <De as Deserializer<'a>>::Error: Error + Send + Sync + 'static, Se: Serializer + Clone + Send + Sync + 'static, Se::Ok: Send + Sync + 'static, Se::Error: Error + Send + Sync + 'static,

Source§

type Response = Response<<Se as Serializer>::Ok>

Responses given by the service.
Source§

type Error = GrpcClientError

Errors produced by the service.
Source§

type Future = Pin<Box<dyn Future<Output = Result<<GrpcClient<S> as Service<GrpcMethodRequest<De, Se>>>::Response, <GrpcClient<S> as Service<GrpcMethodRequest<De, Se>>>::Error>> + Send>>

The future response value.
Source§

fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
Source§

fn call(&mut self, req: GrpcMethodRequest<De, Se>) -> Self::Future

Process the request and return the response asynchronously. Read more
Source§

impl<D, S> StructuralPartialEq for GrpcMethodRequest<D, S>

Auto Trait Implementations§

§

impl<D, S> !Freeze for GrpcMethodRequest<D, S>

§

impl<D, S> RefUnwindSafe for GrpcMethodRequest<D, S>

§

impl<D, S> Send for GrpcMethodRequest<D, S>
where D: Send, S: Send,

§

impl<D, S> Sync for GrpcMethodRequest<D, S>
where D: Sync, S: Sync,

§

impl<D, S> Unpin for GrpcMethodRequest<D, S>
where D: Unpin, S: Unpin,

§

impl<D, S> UnwindSafe for GrpcMethodRequest<D, S>
where D: UnwindSafe, S: 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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>,

Source§

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<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

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