pub struct PrebuiltType { /* private fields */ }
Expand description
A state input that has been configured but has not yet been registered with a Blueprint
.
§Guide
Check out the “Dependency injection” section of Pavex’s guide for a thorough introduction to dependency injection in Pavex applications.
§Use cases
PrebuiltType
is primarily used by kits to allow users to customize (or disable!)
state inputs before registering them with a Blueprint
.
Implementations§
Source§impl PrebuiltType
impl PrebuiltType
Sourcepub fn new(type_: RawIdentifiers) -> Self
pub fn new(type_: RawIdentifiers) -> Self
Create a new (unregistered) state input.
Check out the documentation of Blueprint::prebuilt
for more details
on state inputs.
Sourcepub fn cloning(self, cloning_strategy: CloningStrategy) -> Self
pub fn cloning(self, cloning_strategy: CloningStrategy) -> Self
Set the cloning strategy for the state input type.
Check out the documentation of CloningStrategy
for more details.
Sourcepub fn clone_if_necessary(self) -> Self
pub fn clone_if_necessary(self) -> Self
Set the cloning strategy to CloningStrategy::CloneIfNecessary
.
Check out PrebuiltType::cloning
for more details.
Sourcepub fn never_clone(self) -> Self
pub fn never_clone(self) -> Self
Set the cloning strategy to CloningStrategy::NeverClone
.
Check out PrebuiltType::cloning
for more details.
Sourcepub fn register(self, bp: &mut Blueprint) -> RegisteredPrebuiltType<'_>
pub fn register(self, bp: &mut Blueprint) -> RegisteredPrebuiltType<'_>
Register this state input with a Blueprint
.
Check out the documentation of Blueprint::prebuilt
for more details.
Trait Implementations§
Source§impl Clone for PrebuiltType
impl Clone for PrebuiltType
Source§fn clone(&self) -> PrebuiltType
fn clone(&self) -> PrebuiltType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more