pub struct LayerRegistry { /* private fields */ }Expand description
Registry of LayerFactorys, split into base (always applied) and
hints (applied only when a Blueprint declares the matching key in
spawner_hints.layers). See the module-level # Factory pattern
notes above for why factories rather than pre-built layers.
Implementations§
Source§impl LayerRegistry
impl LayerRegistry
Sourcepub fn with_base<F>(self, factory: F) -> Self
pub fn with_base<F>(self, factory: F) -> Self
Register a base layer factory that is applied on every Blueprint bind
(for layers that must fire for every task — e.g. AuditMiddleware).
Sourcepub fn with_hint<F>(self, key: impl Into<String>, factory: F) -> Self
pub fn with_hint<F>(self, key: impl Into<String>, factory: F) -> Self
Register a layer factory addressable by hint key. If
Blueprint.spawner_hints.layers lists the same key, it is wrapped at
bind time; otherwise it is a no-op.
Sourcepub fn base_factories(&self) -> &[LayerFactory] ⓘ
pub fn base_factories(&self) -> &[LayerFactory] ⓘ
All registered base-layer factories, in registration order.
Sourcepub fn lookup_hint(&self, key: &str) -> Option<&LayerFactory>
pub fn lookup_hint(&self, key: &str) -> Option<&LayerFactory>
Looks up the hint-layer factory registered under key, if any.
Trait Implementations§
Source§impl Clone for LayerRegistry
impl Clone for LayerRegistry
Source§fn clone(&self) -> LayerRegistry
fn clone(&self) -> LayerRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for LayerRegistry
impl Default for LayerRegistry
Source§fn default() -> LayerRegistry
fn default() -> LayerRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for LayerRegistry
impl !UnwindSafe for LayerRegistry
impl Freeze for LayerRegistry
impl Send for LayerRegistry
impl Sync for LayerRegistry
impl Unpin for LayerRegistry
impl UnsafeUnpin for LayerRegistry
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
Mutably borrows from an owned value. Read more
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,
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>
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