Struct sycamore_reactive::BoundedScope
source · [−]pub struct BoundedScope<'a, 'b: 'a> { /* private fields */ }
Expand description
A reference to a reactive scope. This reference is Copy
, allowing it to be copied into
closures without any clones.
The intended way to access a Scope
is with the create_scope
function.
Lifetime
'a
- The lifetime of the scope and all data allocated on it. This allows passing in data from an outer scope into an inner scope. This lifetime is invariant because it is used within an cell.'b
- The bounded lifetime of the scope. This ensures that the scope cannot live longer than this lifetime. This lifetime is covariant because if the scope can outlive'b1
, it can also outlive'b2
if'b1: 'b2
.
As a convenience, the Scope
type alias is provided that uses the same lifetime for both 'a
and 'b
. Any BoundedScope
can be casted to a Scope
because the second lifetime
parameter is always longer than the first.
Trait Implementations
sourceimpl<'a, 'b: 'a> Clone for BoundedScope<'a, 'b>
impl<'a, 'b: 'a> Clone for BoundedScope<'a, 'b>
sourcefn clone(&self) -> BoundedScope<'a, 'b>
fn clone(&self) -> BoundedScope<'a, 'b>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<'a, 'b: 'a> Copy for BoundedScope<'a, 'b>
Auto Trait Implementations
impl<'a, 'b> !RefUnwindSafe for BoundedScope<'a, 'b>
impl<'a, 'b> !Send for BoundedScope<'a, 'b>
impl<'a, 'b> !Sync for BoundedScope<'a, 'b>
impl<'a, 'b> Unpin for BoundedScope<'a, 'b>
impl<'a, 'b> !UnwindSafe for BoundedScope<'a, 'b>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more