pub struct UiContainer { /* private fields */ }
Implementations§
Source§impl UiContainer
impl UiContainer
Sourcepub fn new() -> UiContainer
pub fn new() -> UiContainer
Creates a new user interface container.
Sourcepub fn new_with_ui(ui: UserInterface) -> UiContainer
pub fn new_with_ui(ui: UserInterface) -> UiContainer
Creates a new user interface container with the given user interface.
Sourcepub fn first(&self) -> &UserInterface
pub fn first(&self) -> &UserInterface
Returns a reference to the first user interface in the container. Panics, if the container is empty.
Sourcepub fn first_mut(&mut self) -> &mut UserInterface
pub fn first_mut(&mut self) -> &mut UserInterface
Returns a reference to the first user interface in the container. Panics, if the container is empty.
Sourcepub fn is_valid_handle(&self, handle: Handle<UserInterface>) -> bool
pub fn is_valid_handle(&self, handle: Handle<UserInterface>) -> bool
Return true if given handle is valid and “points” to “alive” user interface.
Sourcepub fn pair_iter(
&self,
) -> impl Iterator<Item = (Handle<UserInterface>, &UserInterface)>
pub fn pair_iter( &self, ) -> impl Iterator<Item = (Handle<UserInterface>, &UserInterface)>
Returns pair iterator which yields (handle, user_interface_ref) pairs.
Sourcepub fn pair_iter_mut(
&mut self,
) -> impl Iterator<Item = (Handle<UserInterface>, &mut UserInterface)>
pub fn pair_iter_mut( &mut self, ) -> impl Iterator<Item = (Handle<UserInterface>, &mut UserInterface)>
Returns pair iterator which yields (handle, user_interface_ref) pairs.
Sourcepub fn try_get(&self, handle: Handle<UserInterface>) -> Option<&UserInterface>
pub fn try_get(&self, handle: Handle<UserInterface>) -> Option<&UserInterface>
Tries to borrow a user interface using its handle.
Sourcepub fn try_get_mut(
&mut self,
handle: Handle<UserInterface>,
) -> Option<&mut UserInterface>
pub fn try_get_mut( &mut self, handle: Handle<UserInterface>, ) -> Option<&mut UserInterface>
Tries to borrow a user interface using its handle.
Sourcepub fn iter(&self) -> impl Iterator<Item = &UserInterface>
pub fn iter(&self) -> impl Iterator<Item = &UserInterface>
Creates new iterator over user interfaces in container.
Sourcepub fn iter_mut(&mut self) -> impl Iterator<Item = &mut UserInterface>
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut UserInterface>
Creates new mutable iterator over user interfaces in container.
Sourcepub fn add(&mut self, scene: UserInterface) -> Handle<UserInterface>
pub fn add(&mut self, scene: UserInterface) -> Handle<UserInterface>
Adds a new user interface into container.
Sourcepub fn remove(&mut self, handle: Handle<UserInterface>)
pub fn remove(&mut self, handle: Handle<UserInterface>)
Removes the given user interface from container. The user interface will be destroyed immediately.
Sourcepub fn take_reserve(
&mut self,
handle: Handle<UserInterface>,
) -> (Ticket<UserInterface>, UserInterface)
pub fn take_reserve( &mut self, handle: Handle<UserInterface>, ) -> (Ticket<UserInterface>, UserInterface)
Takes a user interface from the container and transfers ownership to caller. You must either
put the user interface back using ticket or call forget_ticket
to make memory used by the
user interface vacant again.
Sourcepub fn put_back(
&mut self,
ticket: Ticket<UserInterface>,
scene: UserInterface,
) -> Handle<UserInterface>
pub fn put_back( &mut self, ticket: Ticket<UserInterface>, scene: UserInterface, ) -> Handle<UserInterface>
Puts a user interface back to the container using its ticket.
Sourcepub fn forget_ticket(&mut self, ticket: Ticket<UserInterface>)
pub fn forget_ticket(&mut self, ticket: Ticket<UserInterface>)
Forgets ticket of a user interface, making place at which ticket points, vacant again.
Trait Implementations§
Source§impl Default for UiContainer
impl Default for UiContainer
Source§fn default() -> UiContainer
fn default() -> UiContainer
Source§impl Index<Handle<UserInterface>> for UiContainer
impl Index<Handle<UserInterface>> for UiContainer
Source§type Output = UserInterface
type Output = UserInterface
Source§fn index(
&self,
index: Handle<UserInterface>,
) -> &<UiContainer as Index<Handle<UserInterface>>>::Output
fn index( &self, index: Handle<UserInterface>, ) -> &<UiContainer as Index<Handle<UserInterface>>>::Output
container[index]
) operation. Read moreSource§impl IndexMut<Handle<UserInterface>> for UiContainer
impl IndexMut<Handle<UserInterface>> for UiContainer
Source§fn index_mut(
&mut self,
index: Handle<UserInterface>,
) -> &mut <UiContainer as Index<Handle<UserInterface>>>::Output
fn index_mut( &mut self, index: Handle<UserInterface>, ) -> &mut <UiContainer as Index<Handle<UserInterface>>>::Output
container[index]
) operation. Read moreAuto Trait Implementations§
impl Freeze for UiContainer
impl !RefUnwindSafe for UiContainer
impl Send for UiContainer
impl Sync for UiContainer
impl Unpin for UiContainer
impl !UnwindSafe for UiContainer
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Any
. Could be used to downcast a trait object
to a particular type.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Any
. Could be used to downcast a trait object
to a particular type.fn into_any(self: Box<T>) -> Box<dyn Any>
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian()
.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.