Skip to main content

AsCFType

Trait AsCFType 

Source
pub unsafe trait AsCFType {
    // Required method
    fn as_ptr(&self) -> *mut c_void;

    // Provided method
    fn to_cf_type(&self) -> CFType { ... }
}
Expand description

Trait for Core Foundation values that can be inserted into CF collections.

§Safety

Implementors must return a non-null, live Core Foundation object pointer of the represented type. The pointer must remain valid for the duration of the borrow and support generic Core Foundation retain/release operations.

Required Methods§

Source

fn as_ptr(&self) -> *mut c_void

Borrow the underlying Core Foundation object pointer.

Provided Methods§

Source

fn to_cf_type(&self) -> CFType

Clone this value as an erased CFType.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§