Struct rusty_spine::Attachment

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

Slot attachments.

Spine API Reference

Attachments are reference counted and can be stored and worked with directly, however, some of the underlying data that attachments point to may be cleared. For this reason, attachments should be used with caution, and only used so long as the SkeletonData they came from remains valid, and only attached to the slot they are meant for.

Implementations§

source§

impl Attachment

source

pub fn as_region(&self) -> Option<RegionAttachment>

Get this attachment as a RegionAttachment, or None if it’s a different type.

source

pub fn as_bounding_box(&self) -> Option<BoundingBoxAttachment>

Get this attachment as a BoundingBoxAttachment, or None if it’s a different type.

source

pub fn as_mesh(&self) -> Option<MeshAttachment>

Get this attachment as a MeshAttachment, or None if it’s a different type.

source

pub fn as_point(&self) -> Option<PointAttachment>

Get this attachment as a PointAttachment, or None if it’s a different type.

source

pub fn as_clipping(&self) -> Option<ClippingAttachment>

Get this attachment as a ClippingAttachment, or None if it’s a different type.

source

pub fn name(&self) -> &str

The attachment’s name.

source

pub fn attachment_type(&self) -> AttachmentType

The attachment’s type.

source

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

Get a pointer to the underlying spine-c type.

Trait Implementations§

source§

impl Clone for Attachment

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Attachment

source§

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

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

impl Drop for Attachment

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl NewFromPtr<spAttachment> for Attachment

source§

unsafe fn new_from_ptr(c_attachment: *mut spAttachment) -> Self

Auto Trait Implementations§

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.