INSObject

Trait INSObject 

Source
pub trait INSObject {
    // Required methods
    fn new() -> Self;
    fn to_id(self) -> id;
    unsafe fn from_id(obj: id) -> Self;
    fn description(&self) -> NSString;
    fn debug_description(&self) -> NSString;
    fn retain(&self) -> Self;
}
Expand description

The group of methods that are fundamental to all Objective-C objects.

Required Methods§

Source

fn new() -> Self

Implemented by subclasses to initialize a new object (the receiver) immediately after memory for it has been allocated.

Source

fn to_id(self) -> id

Returns a an id.

Source

unsafe fn from_id(obj: id) -> Self

Returns Self representation of the object.

§Safety

This function dereferences a raw pointer

Source

fn description(&self) -> NSString

Returns a string that represents the contents of the receiving class.

Source

fn debug_description(&self) -> NSString

Returns a string that represents the contents of the receiving class.

Source

fn retain(&self) -> Self

Increments the receiver’s reference count.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§