Struct rusty_spine::SkinHandle
source · pub struct SkinHandle { /* private fields */ }
Expand description
A storeable reference to a Skin
.
Can be acquired from a
CTmpRef<SkeletonData, Skin>
, CTmpMut<SkeletonData, Skin>
,
CTmpRef<Skeleton, Skin>
, or CTmpMut<Skeleton, Skin>
.
let skeleton_data = skeleton.data();
let skin_handles: Vec<SkinHandle> = skeleton_data.skins().map(|skin| skin.handle()).collect();
for skin_handle in skin_handles.iter() {
let skin = skin_handle.get(skeleton_data.as_ref()).unwrap();
println!("{}", skin.name());
}
Implementations§
source§impl SkinHandle
impl SkinHandle
sourcepub fn get<'a>(
&self,
parent: &'a SkeletonData
) -> Option<CTmpRef<'a, SkeletonData, Skin>>
pub fn get<'a>( &self, parent: &'a SkeletonData ) -> Option<CTmpRef<'a, SkeletonData, Skin>>
Safely acquired the item, verifying its existence using its parent.
sourcepub fn get_mut<'a>(
&self,
parent: &'a mut SkeletonData
) -> Option<CTmpMut<'a, SkeletonData, Skin>>
pub fn get_mut<'a>( &self, parent: &'a mut SkeletonData ) -> Option<CTmpMut<'a, SkeletonData, Skin>>
Safely acquired the item, verifying its existence using its parent.
sourcepub unsafe fn get_unchecked(&self) -> Skin
pub unsafe fn get_unchecked(&self) -> Skin
§Safety
Acquire the item without any checks. This is a direct pointer access which is fast but will segfault if the data has been disposed of already.
Trait Implementations§
source§impl Clone for SkinHandle
impl Clone for SkinHandle
source§fn clone(&self) -> SkinHandle
fn clone(&self) -> SkinHandle
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SkinHandle
impl Debug for SkinHandle
source§impl PartialEq for SkinHandle
impl PartialEq for SkinHandle
source§fn eq(&self, other: &SkinHandle) -> bool
fn eq(&self, other: &SkinHandle) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for SkinHandle
impl Eq for SkinHandle
impl StructuralPartialEq for SkinHandle
Auto Trait Implementations§
impl Freeze for SkinHandle
impl RefUnwindSafe for SkinHandle
impl Send for SkinHandle
impl Sync for SkinHandle
impl Unpin for SkinHandle
impl UnwindSafe for SkinHandle
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