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<'a>(&self) -> Skin
pub unsafe fn get_unchecked<'a>(&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<SkinHandle> for SkinHandle
impl PartialEq<SkinHandle> 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 ==
.