Struct pavex::blueprint::prebuilt::RegisteredPrebuiltType
source · pub struct RegisteredPrebuiltType<'a> { /* private fields */ }
Expand description
The type returned by Blueprint::prebuilt
.
It allows you to further configure the behaviour of the registered prebuilt type.
Implementations§
source§impl<'a> RegisteredPrebuiltType<'a>
impl<'a> RegisteredPrebuiltType<'a>
sourcepub fn cloning(self, strategy: CloningStrategy) -> Self
pub fn cloning(self, strategy: CloningStrategy) -> Self
Set the cloning strategy for the output type returned by this constructor.
By default,
Pavex will never try to clone the output type returned by a constructor.
If the output type implements Clone
, you can change the default by setting the cloning strategy
to CloningStrategy::CloneIfNecessary
: Pavex will clone the output type if
it’s necessary to generate code that satisfies Rust’s borrow checker.
sourcepub fn clone_if_necessary(self) -> Self
pub fn clone_if_necessary(self) -> Self
Set the cloning strategy to CloningStrategy::CloneIfNecessary
.
Check out RegisteredPrebuiltType::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 RegisteredPrebuiltType::cloning
for more details.