pub struct Scene {
pub size: RwLock<Point>,
/* private fields */
}Fields§
§size: RwLock<Point>Implementations§
source§impl Scene
impl Scene
pub fn set_size(&self, width: f32, height: f32)
pub fn with_arena<T: Send + Sync>( &self, f: impl FnOnce(&Arena<SceneNode>) -> T, ) -> T
sourcepub fn try_with_arena<T: Send + Sync>(
&self,
f: impl FnOnce(&Arena<SceneNode>) -> T,
) -> Option<T>
pub fn try_with_arena<T: Send + Sync>( &self, f: impl FnOnce(&Arena<SceneNode>) -> T, ) -> Option<T>
Try to run f with a read guard; returns None if the lock is contended.
sourcepub fn try_with_arena_mut<T>(
&self,
f: impl FnOnce(&mut Arena<SceneNode>) -> T,
) -> Option<T>
pub fn try_with_arena_mut<T>( &self, f: impl FnOnce(&mut Arena<SceneNode>) -> T, ) -> Option<T>
Try to run f with a write guard; returns None if the lock is contended.
pub fn with_renderable_arena<T: Send + Sync>( &self, f: impl FnOnce(&IndexMap<usize, SceneNodeRenderable>) -> T, ) -> T
sourcepub fn try_with_renderable_arena<T: Send + Sync>(
&self,
f: impl FnOnce(&IndexMap<usize, SceneNodeRenderable>) -> T,
) -> Option<T>
pub fn try_with_renderable_arena<T: Send + Sync>( &self, f: impl FnOnce(&IndexMap<usize, SceneNodeRenderable>) -> T, ) -> Option<T>
Try to run f with a read guard on the renderables arena.
sourcepub fn try_with_renderable_arena_mut<T>(
&self,
f: impl FnOnce(&mut IndexMap<usize, SceneNodeRenderable>) -> T,
) -> Option<T>
pub fn try_with_renderable_arena_mut<T>( &self, f: impl FnOnce(&mut IndexMap<usize, SceneNodeRenderable>) -> T, ) -> Option<T>
Try to run f with a write guard on the renderables arena.
sourcepub fn snapshot(&self) -> SceneSnapshot
pub fn snapshot(&self) -> SceneSnapshot
Returns a serializable snapshot of the scene, including the root size and node hierarchy.
sourcepub fn serialize_state_pretty(&self) -> Result<String>
pub fn serialize_state_pretty(&self) -> Result<String>
Serializes the current scene snapshot into a pretty formatted JSON string for debugging.
Auto Trait Implementations§
impl !Freeze for Scene
impl RefUnwindSafe for Scene
impl Send for Scene
impl Sync for Scene
impl Unpin for Scene
impl UnwindSafe for Scene
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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