pub struct ClipRegistry { /* private fields */ }Expand description
A named store for AnimationClips.
Implementations§
Source§impl ClipRegistry
impl ClipRegistry
pub fn new() -> Self
Sourcepub fn register(&mut self, clip: AnimationClip) -> bool
pub fn register(&mut self, clip: AnimationClip) -> bool
Register a clip. Returns true if a clip with the same name was replaced.
Sourcepub fn unregister(&mut self, name: &str) -> Option<AnimationClip>
pub fn unregister(&mut self, name: &str) -> Option<AnimationClip>
Unregister a clip by name. Returns the removed clip if it existed.
Sourcepub fn get(&self, name: &str) -> Option<&AnimationClip>
pub fn get(&self, name: &str) -> Option<&AnimationClip>
Look up a clip by name.
Sourcepub fn get_mut(&mut self, name: &str) -> Option<&mut AnimationClip>
pub fn get_mut(&mut self, name: &str) -> Option<&mut AnimationClip>
Mutable access to a clip by name.
pub fn is_empty(&self) -> bool
Sourcepub fn iter(&self) -> impl Iterator<Item = (&str, &AnimationClip)>
pub fn iter(&self) -> impl Iterator<Item = (&str, &AnimationClip)>
Iterate over all clips.
Trait Implementations§
Source§impl Debug for ClipRegistry
impl Debug for ClipRegistry
Source§impl Default for ClipRegistry
impl Default for ClipRegistry
Source§fn default() -> ClipRegistry
fn default() -> ClipRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ClipRegistry
impl RefUnwindSafe for ClipRegistry
impl Send for ClipRegistry
impl Sync for ClipRegistry
impl Unpin for ClipRegistry
impl UnsafeUnpin for ClipRegistry
impl UnwindSafe for ClipRegistry
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
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.