Struct OptionalBody
pub struct OptionalBody<B> { /* private fields */ }Expand description
An optional StreamingBody.
Implementations§
§impl<B> OptionalBody<B>
impl<B> OptionalBody<B>
pub const fn some(inner: B) -> OptionalBody<B>
pub const fn some(inner: B) -> OptionalBody<B>
Create an OptionalBody using the given inner StreamingBody.
pub const fn none() -> OptionalBody<B>
pub const fn none() -> OptionalBody<B>
Create an empty OptionalBody which will return zero Frames.
pub const fn as_ref(&self) -> Option<&B>
pub const fn as_ref(&self) -> Option<&B>
Get an optional shared reference to the inner
StreamingBody if there’s any.
pub const fn as_mut(&mut self) -> Option<&mut B>
pub const fn as_mut(&mut self) -> Option<&mut B>
Get an optional exclusive reference to the inner
StreamingBody if there’s any.
Trait Implementations§
§impl<B> Clone for OptionalBody<B>where
B: Clone,
impl<B> Clone for OptionalBody<B>where
B: Clone,
§fn clone(&self) -> OptionalBody<B>
fn clone(&self) -> OptionalBody<B>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl<B> Debug for OptionalBody<B>where
B: Debug,
impl<B> Debug for OptionalBody<B>where
B: Debug,
§impl<B> Default for OptionalBody<B>
impl<B> Default for OptionalBody<B>
§fn default() -> OptionalBody<B>
fn default() -> OptionalBody<B>
Returns the “default value” for a type. Read more
§impl<B> From<B> for OptionalBody<B>
impl<B> From<B> for OptionalBody<B>
§fn from(value: B) -> OptionalBody<B>
fn from(value: B) -> OptionalBody<B>
Converts to this type from the input type.
§impl<B> Body for OptionalBody<B>where
B: Body,
impl<B> Body for OptionalBody<B>where
B: Body,
§fn poll_frame(
self: Pin<&mut OptionalBody<B>>,
cx: &mut Context<'_>,
) -> Poll<Option<Result<Frame<<OptionalBody<B> as Body>::Data>, <OptionalBody<B> as Body>::Error>>>
fn poll_frame( self: Pin<&mut OptionalBody<B>>, cx: &mut Context<'_>, ) -> Poll<Option<Result<Frame<<OptionalBody<B> as Body>::Data>, <OptionalBody<B> as Body>::Error>>>
Attempt to pull out the next data buffer of this stream.
§fn is_end_stream(&self) -> bool
fn is_end_stream(&self) -> bool
Returns
true when the end of stream has been reached. Read moreimpl<'__pin, B> Unpin for OptionalBody<B>where
<PinnedFieldsOfHelperStruct<__Origin<'__pin, B>> as PinnedFieldsOfHelperTrait>::Actual: Unpin,
Auto Trait Implementations§
impl<B> Freeze for OptionalBody<B>where
B: Freeze,
impl<B> RefUnwindSafe for OptionalBody<B>where
B: RefUnwindSafe,
impl<B> Send for OptionalBody<B>where
B: Send,
impl<B> Sync for OptionalBody<B>where
B: Sync,
impl<B> UnwindSafe for OptionalBody<B>where
B: UnwindSafe,
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,
§impl<T> BodyExt for T
impl<T> BodyExt for T
§fn frame(&mut self) -> Frame<'_, Self> ⓘwhere
Self: Unpin,
fn frame(&mut self) -> Frame<'_, Self> ⓘwhere
Self: Unpin,
Returns a future that resolves to the next
Frame, if any.§fn boxed_unsync(self) -> UnsyncBoxBody<Self::Data, Self::Error>
fn boxed_unsync(self) -> UnsyncBoxBody<Self::Data, Self::Error>
Turn this body into a boxed trait object that is !Sync.
§fn collect(self) -> Collect<Self> ⓘwhere
Self: Sized,
fn collect(self) -> Collect<Self> ⓘwhere
Self: Sized,
Turn this body into
Collected body which will collect all the DATA frames
and trailers.§fn with_trailers<F>(self, trailers: F) -> WithTrailers<Self, F>
fn with_trailers<F>(self, trailers: F) -> WithTrailers<Self, F>
Add trailers to the body. Read more
§fn into_data_stream(self) -> BodyDataStream<Self>where
Self: Sized,
fn into_data_stream(self) -> BodyDataStream<Self>where
Self: Sized,
Turn this body into
BodyDataStream.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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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