pub struct Surface { /* private fields */ }Expand description
The complete per-surface world plus its reactive SurfaceHandle. Build one per window/layer-surface
with Surface::new; activate it with Surface::enter.
Implementations§
Source§impl Surface
impl Surface
Sourcepub fn new() -> Rc<Self>
pub fn new() -> Rc<Self>
Allocates a fresh, inactive surface world with a unique handle and registers it so the reactive
flush can re-enter it for its effects. The returned Rc is the sole owner; the registry keeps only a
Weak, so dropping the Rc tears the surface down (and unregisters it).
Sourcepub fn handle(&self) -> SurfaceHandle
pub fn handle(&self) -> SurfaceHandle
This surface’s reactive handle. Effects registered while it is active capture it and re-run under it.
Sourcepub fn enter(&self) -> SurfaceGuard
pub fn enter(&self) -> SurfaceGuard
Activates this surface’s world until the returned guard drops, which restores the previously-active
world. The swapped worlds are independent thread-locals, so restore order among them is irrelevant;
nesting enters is fine.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Surface
impl !Send for Surface
impl !Sync for Surface
impl !UnwindSafe for Surface
impl Freeze for Surface
impl Unpin for Surface
impl UnsafeUnpin for Surface
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