pub struct Scope<T>(/* private fields */)
where
T: ?Sized;
Expand description
A scope. There’s usually one scope per thread.
Note: Usually you don’t use this directly. See thread_scoped_ref
(with example)
and with
/ scoped
.
§Safety
This struct uses unsafe functionality. When calling the scope
function a reference to the
value is kept as long as the scope
function is running. The reference to the value
is removed when the scope function ends. To make sure the reference is removed even in the
case of a panic, there’s a cleanup struct that performs cleanup when dropped.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for Scope<T>
impl<T> !RefUnwindSafe for Scope<T>
impl<T> !Send for Scope<T>
impl<T> !Sync for Scope<T>
impl<T> Unpin for Scope<T>where
T: ?Sized,
impl<T> UnwindSafe for Scope<T>where
T: RefUnwindSafe + ?Sized,
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