Struct rusty_spine::Slot

source ·
pub struct Slot { /* private fields */ }
Expand description

A slot for an attachment.

Spine API Reference

Implementations§

source§

impl Slot

source

pub unsafe fn set_attachment(&mut self, attachment: Option<Attachment>)

Sets the attachment for this slot.

§Safety

The attachment must be compatible with this slot, usually by originating from it.

source

pub fn set_to_setup_pose(&mut self)

Sets this slot to the setup pose.

source

pub fn handle(&self) -> SlotHandle

Create a persistent SlotHandle to this Slot.

source

pub fn region_attachment(&self) -> Option<CTmpRef<'_, Self, RegionAttachment>>

The RegionAttachment attached to this slot, or None if the attachment is a different type.

source

pub fn bounding_box_attachment( &self ) -> Option<CTmpRef<'_, Self, BoundingBoxAttachment>>

The BoundingBoxAttachment attached to this slot, or None if the attachment is a different type.

source

pub fn mesh_attachment(&self) -> Option<CTmpRef<'_, Self, MeshAttachment>>

The MeshAttachment attached to this slot, or None if the attachment is a different type.

source

pub fn point_attachment(&self) -> Option<CTmpRef<'_, Self, PointAttachment>>

The PointAttachment attached to this slot, or None if the attachment is a different type.

source

pub fn clipping_attachment( &self ) -> Option<CTmpRef<'_, Self, ClippingAttachment>>

The ClippingAttachment attached to this slot, or None if the attachment is a different type.

source

pub fn color(&self) -> Color

The color used to tint the slot’s attachment. If dark_color is set, this is used as the light color for two color tinting.

source

pub fn color_mut(&mut self) -> &mut Color

Set the color used to tint the slot’s attachment. If dark_color is set, this is used as the light color for two color tinting.

source

pub fn dark_color(&self) -> Option<Color>

The dark color used to tint the slot’s attachment for two color tinting, or None if two color tinting is not used. The dark color’s alpha is not used.

source

pub fn data(&self) -> CTmpRef<'_, Self, SlotData>

The slot’s setup pose data.

source

pub fn data_mut(&mut self) -> CTmpMut<'_, Self, SlotData>

The slot’s mutable setup pose data.

source

pub fn bone(&self) -> CTmpRef<'_, Self, Bone>

The bone this slot belongs to.

source

pub fn bone_mut(&mut self) -> CTmpMut<'_, Self, Bone>

The mutable bone this slot belongs to.

source

pub fn attachment(&self) -> Option<CTmpRef<'_, Self, Attachment>>

The current attachment for the slot, or None if the slot has no attachment.

source

pub fn attachment_mut(&mut self) -> Option<CTmpMut<'_, Self, Attachment>>

The current mutable attachment for the slot, or None if the slot has no attachment.

source

pub const fn c_ptr(&self) -> *mut spSlot

Get a pointer to the underlying spine-c type.

source

pub fn sequence_index(&self) -> usize

Trait Implementations§

source§

impl Debug for Slot

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl NewFromPtr<spSlot> for Slot

source§

unsafe fn new_from_ptr(c_slot: *mut spSlot) -> Self

Auto Trait Implementations§

§

impl Freeze for Slot

§

impl RefUnwindSafe for Slot

§

impl Send for Slot

§

impl Sync for Slot

§

impl Unpin for Slot

§

impl UnwindSafe for Slot

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.