Struct fyrox::scene::SceneContainer
source · pub struct SceneContainer { /* private fields */ }
Expand description
Container for scenes in the engine.
Implementations§
source§impl SceneContainer
impl SceneContainer
sourcepub fn is_valid_handle(&self, handle: Handle<Scene>) -> bool
pub fn is_valid_handle(&self, handle: Handle<Scene>) -> bool
Return true if given handle is valid and “points” to “alive” scene.
sourcepub fn pair_iter(&self) -> impl Iterator<Item = (Handle<Scene>, &Scene)>
pub fn pair_iter(&self) -> impl Iterator<Item = (Handle<Scene>, &Scene)>
Returns pair iterator which yields (handle, scene_ref) pairs.
sourcepub fn pair_iter_mut(
&mut self
) -> impl Iterator<Item = (Handle<Scene>, &mut Scene)>
pub fn pair_iter_mut( &mut self ) -> impl Iterator<Item = (Handle<Scene>, &mut Scene)>
Returns pair iterator which yields (handle, scene_ref) pairs.
sourcepub fn try_get(&self, handle: Handle<Scene>) -> Option<&Scene>
pub fn try_get(&self, handle: Handle<Scene>) -> Option<&Scene>
Tries to borrow a scene using its handle.
sourcepub fn try_get_mut(&mut self, handle: Handle<Scene>) -> Option<&mut Scene>
pub fn try_get_mut(&mut self, handle: Handle<Scene>) -> Option<&mut Scene>
Tries to borrow a scene using its handle.
sourcepub fn iter(&self) -> impl Iterator<Item = &Scene>
pub fn iter(&self) -> impl Iterator<Item = &Scene>
Creates new iterator over scenes in container.
sourcepub fn iter_mut(&mut self) -> impl Iterator<Item = &mut Scene>
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut Scene>
Creates new mutable iterator over scenes in container.
sourcepub fn remove(&mut self, handle: Handle<Scene>)
pub fn remove(&mut self, handle: Handle<Scene>)
Removes given scene from container. The scene will be destroyed on a next update call.
sourcepub fn take_reserve(&mut self, handle: Handle<Scene>) -> (Ticket<Scene>, Scene)
pub fn take_reserve(&mut self, handle: Handle<Scene>) -> (Ticket<Scene>, Scene)
Takes scene from the container and transfers ownership to caller. You must either
put scene back using ticket or call forget_ticket
to make memory used by scene
vacant again.
sourcepub fn put_back(&mut self, ticket: Ticket<Scene>, scene: Scene) -> Handle<Scene>
pub fn put_back(&mut self, ticket: Ticket<Scene>, scene: Scene) -> Handle<Scene>
Puts scene back using its ticket.
sourcepub fn forget_ticket(&mut self, ticket: Ticket<Scene>)
pub fn forget_ticket(&mut self, ticket: Ticket<Scene>)
Forgets ticket of a scene, making place at which ticket points, vacant again.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SceneContainer
impl !RefUnwindSafe for SceneContainer
impl Send for SceneContainer
impl !Sync for SceneContainer
impl Unpin for SceneContainer
impl !UnwindSafe for SceneContainer
Blanket Implementations§
source§impl<T> AsyncTaskResult for T
impl<T> AsyncTaskResult for T
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
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.source§impl<T> FieldValue for Twhere
T: 'static,
impl<T> FieldValue for Twhere
T: 'static,
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§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> ⓘ
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> ⓘ
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 moresource§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.