Struct pavex::blueprint::prebuilt::PrebuiltType
source · 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 moreAuto Trait Implementations§
impl Freeze for PrebuiltType
impl RefUnwindSafe for PrebuiltType
impl Send for PrebuiltType
impl Sync for PrebuiltType
impl Unpin for PrebuiltType
impl UnwindSafe for PrebuiltType
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)