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.