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 duplicate 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 for PrototypeScope
impl PartialEq for PrototypeScope
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 a given instance in the scope. The scope might not support storing instances and
ignore it.
impl Copy for PrototypeScope
impl Eq for PrototypeScope
impl StructuralPartialEq for PrototypeScope
Auto Trait Implementations§
impl Freeze for PrototypeScope
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more