pub struct Root<'a> {
sexp: SEXP,
_scope: PhantomData<&'a ProtectScope>,
}Expand description
A rooted SEXP tied to the lifetime of a ProtectScope.
This type has no Drop. The scope owns unprotection responsibility.
This makes Root cheap to move and copy (it’s just a pointer + lifetime).
§Lifetime
The 'a lifetime ties the root to its creating scope. The compiler ensures
you cannot use the root after the scope has been dropped.
Fields§
§sexp: SEXP§_scope: PhantomData<&'a ProtectScope>Implementations§
Trait Implementations§
impl<'a> Copy for Root<'a>
Auto Trait Implementations§
impl<'a> Freeze for Root<'a>
impl<'a> !RefUnwindSafe for Root<'a>
impl<'a> !Send for Root<'a>
impl<'a> !Sync for Root<'a>
impl<'a> Unpin for Root<'a>
impl<'a> UnsafeUnpin for Root<'a>
impl<'a> !UnwindSafe for Root<'a>
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