Struct Request
pub struct Request<T> { /* private fields */ }Expand description
A gRPC request and metadata from an RPC call.
Implementations§
§impl<T> Request<T>
impl<T> Request<T>
pub fn new(message: T) -> Request<T>
pub fn new(message: T) -> Request<T>
Create a new gRPC request.
Request::new(HelloRequest {
name: "Bob".into(),
});pub fn metadata(&self) -> &MetadataMap
pub fn metadata(&self) -> &MetadataMap
Get a reference to the custom request metadata.
pub fn metadata_mut(&mut self) -> &mut MetadataMap
pub fn metadata_mut(&mut self) -> &mut MetadataMap
Get a mutable reference to the request metadata.
pub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consumes self, returning the message
pub fn into_parts(self) -> (MetadataMap, Extensions, T)
pub fn into_parts(self) -> (MetadataMap, Extensions, T)
Consumes self returning the parts of the request.
pub fn from_parts(
metadata: MetadataMap,
extensions: Extensions,
message: T,
) -> Request<T>
pub fn from_parts( metadata: MetadataMap, extensions: Extensions, message: T, ) -> Request<T>
Create a new gRPC request from metadata, extensions and message.
pub fn try_set_timeout(&mut self, deadline: Duration) -> Result<(), OpaqueError>
pub fn try_set_timeout(&mut self, deadline: Duration) -> Result<(), OpaqueError>
Set the max duration the request is allowed to take.
Requires the server to support the grpc-timeout metadata, which rama-grpc does.
The duration will be formatted according to the spec and use the most precise unit possible.
Trait Implementations§
§impl<T> ExtensionsMut for Request<T>
impl<T> ExtensionsMut for Request<T>
§fn extensions_mut(&mut self) -> &mut Extensions
fn extensions_mut(&mut self) -> &mut Extensions
Get mutable reference to the underlying
Extensions store§impl<T> ExtensionsRef for Request<T>
impl<T> ExtensionsRef for Request<T>
§fn extensions(&self) -> &Extensions
fn extensions(&self) -> &Extensions
Get reference to the underlying
Extensions store§impl<T> IntoRequest<T> for Request<T>
impl<T> IntoRequest<T> for Request<T>
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a rama_grpc::RequestAuto Trait Implementations§
impl<T> Freeze for Request<T>where
T: Freeze,
impl<T> !RefUnwindSafe for Request<T>
impl<T> Send for Request<T>where
T: Send,
impl<T> Sync for Request<T>where
T: Sync,
impl<T> Unpin for Request<T>where
T: Unpin,
impl<T> !UnwindSafe for Request<T>
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
Mutably borrows from an owned value. Read more
§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> ⓘ
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 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> ⓘ
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
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>
Create a new
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more