Struct springtime_di::scope::PrototypeScope
source · pub struct PrototypeScope;Expand description
A scope which creates a new instance of a given component on each request. Stateful components usually should be stored in a prototype scope.
Trait Implementations§
source§impl Clone for PrototypeScope
impl Clone for PrototypeScope
source§fn clone(&self) -> PrototypeScope
fn clone(&self) -> PrototypeScope
Returns a copy of the value. Read more
1.0.0 · 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 PrototypeScope
impl Default for PrototypeScope
source§fn default() -> PrototypeScope
fn default() -> PrototypeScope
Returns the “default value” for a type. Read more
source§impl PartialEq<PrototypeScope> for PrototypeScope
impl PartialEq<PrototypeScope> for PrototypeScope
source§fn eq(&self, other: &PrototypeScope) -> bool
fn eq(&self, other: &PrototypeScope) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Scope for PrototypeScope
impl Scope for PrototypeScope
source§fn instance(
&self,
_definition: &ComponentDefinition
) -> Option<ComponentInstanceAnyPtr>
fn instance( &self, _definition: &ComponentDefinition ) -> Option<ComponentInstanceAnyPtr>
Gets an instance requested for the given definition, if available in this scope.
source§fn store_instance(
&mut self,
_definition: &ComponentDefinition,
_instance: ComponentInstanceAnyPtr
)
fn store_instance( &mut self, _definition: &ComponentDefinition, _instance: ComponentInstanceAnyPtr )
Stores given instance in the scope. The scope might not support storing instances and ignore
it.
impl Copy for PrototypeScope
impl Eq for PrototypeScope
impl StructuralEq for PrototypeScope
impl StructuralPartialEq for PrototypeScope
Auto Trait Implementations§
impl RefUnwindSafe for PrototypeScope
impl Send for PrototypeScope
impl Sync for PrototypeScope
impl Unpin for PrototypeScope
impl UnwindSafe for PrototypeScope
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