Struct ScopeLayer
pub struct ScopeLayer { /* private fields */ }Expand description
Runs every input in its own child Scope, see the module docs.
Implementations§
§impl ScopeLayer
impl ScopeLayer
pub const fn new() -> ScopeLayer
Available on crate feature std only.
pub const fn new() -> ScopeLayer
std only.A layer that only gives every input its own child scope.
pub fn maybe_with_parent(self, parent: Option<WeakScope>) -> ScopeLayer
Available on crate feature std only.
pub fn maybe_with_parent(self, parent: Option<WeakScope>) -> ScopeLayer
std only.Also run every input in parent, such as the scope of the server that serves
it, besides the scope the input already runs in. The layer does not hold it: an
input arriving once it is closed is refused.
pub fn maybe_set_parent(&mut self, parent: Option<WeakScope>) -> &mut ScopeLayer
Available on crate feature std only.
pub fn maybe_set_parent(&mut self, parent: Option<WeakScope>) -> &mut ScopeLayer
std only.Also run every input in parent, such as the scope of the server that serves
it, besides the scope the input already runs in. The layer does not hold it: an
input arriving once it is closed is refused.
pub fn with_parent(self, parent: WeakScope) -> ScopeLayer
Available on crate feature std only.
pub fn with_parent(self, parent: WeakScope) -> ScopeLayer
std only.Also run every input in parent, such as the scope of the server that serves
it, besides the scope the input already runs in. The layer does not hold it: an
input arriving once it is closed is refused.
pub fn set_parent(&mut self, parent: WeakScope) -> &mut ScopeLayer
Available on crate feature std only.
pub fn set_parent(&mut self, parent: WeakScope) -> &mut ScopeLayer
std only.Also run every input in parent, such as the scope of the server that serves
it, besides the scope the input already runs in. The layer does not hold it: an
input arriving once it is closed is refused.
pub fn without_parent(self) -> ScopeLayer
Available on crate feature std only.
pub fn without_parent(self) -> ScopeLayer
std only.Also run every input in parent, such as the scope of the server that serves
it, besides the scope the input already runs in. The layer does not hold it: an
input arriving once it is closed is refused.
pub fn unset_parent(&mut self) -> &mut ScopeLayer
Available on crate feature std only.
pub fn unset_parent(&mut self) -> &mut ScopeLayer
std only.Also run every input in parent, such as the scope of the server that serves
it, besides the scope the input already runs in. The layer does not hold it: an
input arriving once it is closed is refused.
pub fn maybe_with_max_age(self, max_age: Option<Duration>) -> ScopeLayer
Available on crate feature std only.
pub fn maybe_with_max_age(self, max_age: Option<Duration>) -> ScopeLayer
std only.Cancel the scope of an input this long after it started.
pub fn maybe_set_max_age(
&mut self,
max_age: Option<Duration>,
) -> &mut ScopeLayer
Available on crate feature std only.
pub fn maybe_set_max_age( &mut self, max_age: Option<Duration>, ) -> &mut ScopeLayer
std only.Cancel the scope of an input this long after it started.
pub fn with_max_age(self, max_age: Duration) -> ScopeLayer
Available on crate feature std only.
pub fn with_max_age(self, max_age: Duration) -> ScopeLayer
std only.Cancel the scope of an input this long after it started.
pub fn set_max_age(&mut self, max_age: Duration) -> &mut ScopeLayer
Available on crate feature std only.
pub fn set_max_age(&mut self, max_age: Duration) -> &mut ScopeLayer
std only.Cancel the scope of an input this long after it started.
pub fn without_max_age(self) -> ScopeLayer
Available on crate feature std only.
pub fn without_max_age(self) -> ScopeLayer
std only.Cancel the scope of an input this long after it started.
pub fn unset_max_age(&mut self) -> &mut ScopeLayer
Available on crate feature std only.
pub fn unset_max_age(&mut self) -> &mut ScopeLayer
std only.Cancel the scope of an input this long after it started.
pub fn with_max_age_jitter(self, jitter: f64) -> ScopeLayer
Available on crate feature std only.
pub fn with_max_age_jitter(self, jitter: f64) -> ScopeLayer
std only.Spread the max age of each input uniformly within ± this fraction of it, so
inputs that started together do not all drain at once. Clamped to 0.0..=1.0;
zero, the default, keeps every max age exact.
pub fn set_max_age_jitter(&mut self, jitter: f64) -> &mut ScopeLayer
Available on crate feature std only.
pub fn set_max_age_jitter(&mut self, jitter: f64) -> &mut ScopeLayer
std only.Spread the max age of each input uniformly within ± this fraction of it, so
inputs that started together do not all drain at once. Clamped to 0.0..=1.0;
zero, the default, keeps every max age exact.
pub fn maybe_with_grace(self, grace: Option<Duration>) -> ScopeLayer
Available on crate feature std only.
pub fn maybe_with_grace(self, grace: Option<Duration>) -> ScopeLayer
std only.Abort the scope of an input this long after it is cancelled, for any cause.
pub fn maybe_set_grace(&mut self, grace: Option<Duration>) -> &mut ScopeLayer
Available on crate feature std only.
pub fn maybe_set_grace(&mut self, grace: Option<Duration>) -> &mut ScopeLayer
std only.Abort the scope of an input this long after it is cancelled, for any cause.
pub fn with_grace(self, grace: Duration) -> ScopeLayer
Available on crate feature std only.
pub fn with_grace(self, grace: Duration) -> ScopeLayer
std only.Abort the scope of an input this long after it is cancelled, for any cause.
pub fn set_grace(&mut self, grace: Duration) -> &mut ScopeLayer
Available on crate feature std only.
pub fn set_grace(&mut self, grace: Duration) -> &mut ScopeLayer
std only.Abort the scope of an input this long after it is cancelled, for any cause.
pub fn without_grace(self) -> ScopeLayer
Available on crate feature std only.
pub fn without_grace(self) -> ScopeLayer
std only.Abort the scope of an input this long after it is cancelled, for any cause.
pub fn unset_grace(&mut self) -> &mut ScopeLayer
Available on crate feature std only.
pub fn unset_grace(&mut self) -> &mut ScopeLayer
std only.Abort the scope of an input this long after it is cancelled, for any cause.
pub fn maybe_with_hard_max_age(
self,
hard_max_age: Option<Duration>,
) -> ScopeLayer
Available on crate feature std only.
pub fn maybe_with_hard_max_age( self, hard_max_age: Option<Duration>, ) -> ScopeLayer
std only.Abort the scope of an input this long after it started.
pub fn maybe_set_hard_max_age(
&mut self,
hard_max_age: Option<Duration>,
) -> &mut ScopeLayer
Available on crate feature std only.
pub fn maybe_set_hard_max_age( &mut self, hard_max_age: Option<Duration>, ) -> &mut ScopeLayer
std only.Abort the scope of an input this long after it started.
pub fn with_hard_max_age(self, hard_max_age: Duration) -> ScopeLayer
Available on crate feature std only.
pub fn with_hard_max_age(self, hard_max_age: Duration) -> ScopeLayer
std only.Abort the scope of an input this long after it started.
pub fn set_hard_max_age(&mut self, hard_max_age: Duration) -> &mut ScopeLayer
Available on crate feature std only.
pub fn set_hard_max_age(&mut self, hard_max_age: Duration) -> &mut ScopeLayer
std only.Abort the scope of an input this long after it started.
pub fn without_hard_max_age(self) -> ScopeLayer
Available on crate feature std only.
pub fn without_hard_max_age(self) -> ScopeLayer
std only.Abort the scope of an input this long after it started.
pub fn unset_hard_max_age(&mut self) -> &mut ScopeLayer
Available on crate feature std only.
pub fn unset_hard_max_age(&mut self) -> &mut ScopeLayer
std only.Abort the scope of an input this long after it started.
Trait Implementations§
§impl Clone for ScopeLayer
impl Clone for ScopeLayer
§fn clone(&self) -> ScopeLayer
fn clone(&self) -> ScopeLayer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ScopeLayer
impl Debug for ScopeLayer
§impl Default for ScopeLayer
impl Default for ScopeLayer
§fn default() -> ScopeLayer
fn default() -> ScopeLayer
§impl<S> Layer<S> for ScopeLayer
impl<S> Layer<S> for ScopeLayer
§type Service = ScopeService<S>
type Service = ScopeService<S>
§fn layer(&self, inner: S) -> <ScopeLayer as Layer<S>>::Service
fn layer(&self, inner: S) -> <ScopeLayer as Layer<S>>::Service
§fn into_layer(self, inner: S) -> <ScopeLayer as Layer<S>>::Service
fn into_layer(self, inner: S) -> <ScopeLayer as Layer<S>>::Service
layer but consuming self after the service was created. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ScopeLayer
impl !UnwindSafe for ScopeLayer
impl Forget for ScopeLayer
impl Freeze for ScopeLayer
impl Send for ScopeLayer
impl Sync for ScopeLayer
impl Unpin for ScopeLayer
impl UnsafeUnpin for ScopeLayer
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
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>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more