[−][src]Trait core_services::TCFType
All Core Foundation types implement this trait. The associated type Ref specifies the
associated Core Foundation type: e.g. for CFType this is CFTypeRef; for CFArray this is
CFArrayRef.
Most structs that implement this trait will do so via the impl_TCFType macro.
Associated Types
type Ref: TCFTypeRef
The reference type wrapped inside this type.
Required methods
fn as_concrete_TypeRef(&self) -> Self::Ref
Returns the object as its concrete TypeRef.
unsafe fn wrap_under_create_rule(obj: Self::Ref) -> Self
Returns an instance of the object, wrapping the underlying CFTypeRef subclass. Use this
when following Core Foundation's "Create Rule". The reference count is not bumped.
fn type_id() -> usize
Returns the type ID for this class.
fn as_CFTypeRef(&self) -> *const c_void
Returns the object as a raw CFTypeRef. The reference count is not adjusted.
unsafe fn wrap_under_get_rule(reference: Self::Ref) -> Self
Returns an instance of the object, wrapping the underlying CFTypeRef subclass. Use this
when following Core Foundation's "Get Rule". The reference count is bumped.
Provided methods
fn as_CFType(&self) -> CFType
Returns the object as a wrapped CFType. The reference count is incremented by one.
fn into_CFType(self) -> CFType
Returns the object as a wrapped CFType. Consumes self and avoids changing the reference
count.
fn retain_count(&self) -> isize
Returns the reference count of the object. It is unwise to do anything other than test whether the return value of this method is greater than zero.
fn type_of(&self) -> usize
Returns the type ID of this object.
fn show(&self)
Writes a debugging version of this object on standard error.
fn instance_of<OtherCFType>(&self) -> bool where
OtherCFType: TCFType,
OtherCFType: TCFType,
Returns true if this value is an instance of another type.
Implementations on Foreign Types
impl TCFType for CFData[src]
type Ref = *const __CFData
fn as_concrete_TypeRef(&self) -> *const __CFData[src]
unsafe fn wrap_under_get_rule(reference: *const __CFData) -> CFData[src]
fn as_CFTypeRef(&self) -> *const c_void[src]
unsafe fn wrap_under_create_rule(reference: *const __CFData) -> CFData[src]
fn type_id() -> usize[src]
impl TCFType for CFNumber[src]
type Ref = *const __CFNumber
fn as_concrete_TypeRef(&self) -> *const __CFNumber[src]
unsafe fn wrap_under_get_rule(reference: *const __CFNumber) -> CFNumber[src]
fn as_CFTypeRef(&self) -> *const c_void[src]
unsafe fn wrap_under_create_rule(reference: *const __CFNumber) -> CFNumber[src]
fn type_id() -> usize[src]
impl TCFType for CFBoolean[src]
type Ref = *const __CFBoolean
fn as_concrete_TypeRef(&self) -> *const __CFBoolean[src]
unsafe fn wrap_under_get_rule(reference: *const __CFBoolean) -> CFBoolean[src]
fn as_CFTypeRef(&self) -> *const c_void[src]
unsafe fn wrap_under_create_rule(reference: *const __CFBoolean) -> CFBoolean[src]
fn type_id() -> usize[src]
impl TCFType for CFAllocator[src]
type Ref = *const c_void
fn as_concrete_TypeRef(&self) -> *const c_void[src]
unsafe fn wrap_under_get_rule(reference: *const c_void) -> CFAllocator[src]
fn as_CFTypeRef(&self) -> *const c_void[src]
unsafe fn wrap_under_create_rule(reference: *const c_void) -> CFAllocator[src]
fn type_id() -> usize[src]
impl TCFType for CFFileDescriptor[src]
type Ref = *mut __CFFileDescriptor
fn as_concrete_TypeRef(&self) -> *mut __CFFileDescriptor[src]
unsafe fn wrap_under_get_rule(
reference: *mut __CFFileDescriptor
) -> CFFileDescriptor[src]
reference: *mut __CFFileDescriptor
) -> CFFileDescriptor
fn as_CFTypeRef(&self) -> *const c_void[src]
unsafe fn wrap_under_create_rule(
reference: *mut __CFFileDescriptor
) -> CFFileDescriptor[src]
reference: *mut __CFFileDescriptor
) -> CFFileDescriptor
fn type_id() -> usize[src]
impl<T> TCFType for CFSet<T>[src]
type Ref = *const __CFSet
fn as_concrete_TypeRef(&self) -> *const __CFSet[src]
unsafe fn wrap_under_get_rule(reference: *const __CFSet) -> CFSet<T>[src]
fn as_CFTypeRef(&self) -> *const c_void[src]
unsafe fn wrap_under_create_rule(reference: *const __CFSet) -> CFSet<T>[src]
fn type_id() -> usize[src]
impl<K, V> TCFType for CFMutableDictionary<K, V>[src]
type Ref = *mut __CFDictionary
fn as_concrete_TypeRef(&self) -> *mut __CFDictionary[src]
unsafe fn wrap_under_get_rule(
reference: *mut __CFDictionary
) -> CFMutableDictionary<K, V>[src]
reference: *mut __CFDictionary
) -> CFMutableDictionary<K, V>
fn as_CFTypeRef(&self) -> *const c_void[src]
unsafe fn wrap_under_create_rule(
reference: *mut __CFDictionary
) -> CFMutableDictionary<K, V>[src]
reference: *mut __CFDictionary
) -> CFMutableDictionary<K, V>
fn type_id() -> usize[src]
impl TCFType for CFRunLoop[src]
type Ref = *mut __CFRunLoop
fn as_concrete_TypeRef(&self) -> *mut __CFRunLoop[src]
unsafe fn wrap_under_get_rule(reference: *mut __CFRunLoop) -> CFRunLoop[src]
fn as_CFTypeRef(&self) -> *const c_void[src]
unsafe fn wrap_under_create_rule(reference: *mut __CFRunLoop) -> CFRunLoop[src]
fn type_id() -> usize[src]
impl TCFType for CFAttributedString[src]
type Ref = *const __CFAttributedString
fn as_concrete_TypeRef(&self) -> *const __CFAttributedString[src]
unsafe fn wrap_under_get_rule(
reference: *const __CFAttributedString
) -> CFAttributedString[src]
reference: *const __CFAttributedString
) -> CFAttributedString
fn as_CFTypeRef(&self) -> *const c_void[src]
unsafe fn wrap_under_create_rule(
reference: *const __CFAttributedString
) -> CFAttributedString[src]
reference: *const __CFAttributedString
) -> CFAttributedString
fn type_id() -> usize[src]
impl TCFType for CFURL[src]
type Ref = *const __CFURL
fn as_concrete_TypeRef(&self) -> *const __CFURL[src]
unsafe fn wrap_under_get_rule(reference: *const __CFURL) -> CFURL[src]
fn as_CFTypeRef(&self) -> *const c_void[src]
unsafe fn wrap_under_create_rule(reference: *const __CFURL) -> CFURL[src]
fn type_id() -> usize[src]
impl TCFType for CFRunLoopObserver[src]
type Ref = *mut __CFRunLoopObserver
fn as_concrete_TypeRef(&self) -> *mut __CFRunLoopObserver[src]
unsafe fn wrap_under_get_rule(
reference: *mut __CFRunLoopObserver
) -> CFRunLoopObserver[src]
reference: *mut __CFRunLoopObserver
) -> CFRunLoopObserver
fn as_CFTypeRef(&self) -> *const c_void[src]
unsafe fn wrap_under_create_rule(
reference: *mut __CFRunLoopObserver
) -> CFRunLoopObserver[src]
reference: *mut __CFRunLoopObserver
) -> CFRunLoopObserver
fn type_id() -> usize[src]
impl TCFType for CFBundle[src]
type Ref = *mut __CFBundle
fn as_concrete_TypeRef(&self) -> *mut __CFBundle[src]
unsafe fn wrap_under_get_rule(reference: *mut __CFBundle) -> CFBundle[src]
fn as_CFTypeRef(&self) -> *const c_void[src]
unsafe fn wrap_under_create_rule(reference: *mut __CFBundle) -> CFBundle[src]
fn type_id() -> usize[src]
impl TCFType for CFMutableAttributedString[src]
type Ref = *const __CFAttributedString
fn as_concrete_TypeRef(&self) -> *const __CFAttributedString[src]
unsafe fn wrap_under_get_rule(
reference: *const __CFAttributedString
) -> CFMutableAttributedString[src]
reference: *const __CFAttributedString
) -> CFMutableAttributedString
fn as_CFTypeRef(&self) -> *const c_void[src]
unsafe fn wrap_under_create_rule(
reference: *const __CFAttributedString
) -> CFMutableAttributedString[src]
reference: *const __CFAttributedString
) -> CFMutableAttributedString
fn type_id() -> usize[src]
impl TCFType for CFTimeZone[src]
type Ref = *const __CFTimeZone
fn as_concrete_TypeRef(&self) -> *const __CFTimeZone[src]
unsafe fn wrap_under_get_rule(reference: *const __CFTimeZone) -> CFTimeZone[src]
fn as_CFTypeRef(&self) -> *const c_void[src]
unsafe fn wrap_under_create_rule(reference: *const __CFTimeZone) -> CFTimeZone[src]
fn type_id() -> usize[src]
impl TCFType for CFDate[src]
type Ref = *const __CFDate
fn as_concrete_TypeRef(&self) -> *const __CFDate[src]
unsafe fn wrap_under_get_rule(reference: *const __CFDate) -> CFDate[src]
fn as_CFTypeRef(&self) -> *const c_void[src]
unsafe fn wrap_under_create_rule(reference: *const __CFDate) -> CFDate[src]
fn type_id() -> usize[src]
impl TCFType for CFUUID[src]
type Ref = *const __CFUUID
fn as_concrete_TypeRef(&self) -> *const __CFUUID[src]
unsafe fn wrap_under_get_rule(reference: *const __CFUUID) -> CFUUID[src]
fn as_CFTypeRef(&self) -> *const c_void[src]
unsafe fn wrap_under_create_rule(reference: *const __CFUUID) -> CFUUID[src]
fn type_id() -> usize[src]
impl TCFType for CFRunLoopTimer[src]
type Ref = *mut __CFRunLoopTimer
fn as_concrete_TypeRef(&self) -> *mut __CFRunLoopTimer[src]
unsafe fn wrap_under_get_rule(
reference: *mut __CFRunLoopTimer
) -> CFRunLoopTimer[src]
reference: *mut __CFRunLoopTimer
) -> CFRunLoopTimer
fn as_CFTypeRef(&self) -> *const c_void[src]
unsafe fn wrap_under_create_rule(
reference: *mut __CFRunLoopTimer
) -> CFRunLoopTimer[src]
reference: *mut __CFRunLoopTimer
) -> CFRunLoopTimer
fn type_id() -> usize[src]
impl TCFType for CFType[src]
type Ref = *const c_void
fn as_concrete_TypeRef(&self) -> *const c_void[src]
unsafe fn wrap_under_get_rule(reference: *const c_void) -> CFType[src]
fn as_CFTypeRef(&self) -> *const c_void[src]
unsafe fn wrap_under_create_rule(obj: *const c_void) -> CFType[src]
fn type_id() -> usize[src]
impl TCFType for CFCharacterSet[src]
type Ref = *const __CFCharacterSet
fn as_concrete_TypeRef(&self) -> *const __CFCharacterSet[src]
unsafe fn wrap_under_get_rule(
reference: *const __CFCharacterSet
) -> CFCharacterSet[src]
reference: *const __CFCharacterSet
) -> CFCharacterSet
fn as_CFTypeRef(&self) -> *const c_void[src]
unsafe fn wrap_under_create_rule(
reference: *const __CFCharacterSet
) -> CFCharacterSet[src]
reference: *const __CFCharacterSet
) -> CFCharacterSet
fn type_id() -> usize[src]
impl<K, V> TCFType for CFDictionary<K, V>[src]
type Ref = *const __CFDictionary
fn as_concrete_TypeRef(&self) -> *const __CFDictionary[src]
unsafe fn wrap_under_get_rule(
reference: *const __CFDictionary
) -> CFDictionary<K, V>[src]
reference: *const __CFDictionary
) -> CFDictionary<K, V>
fn as_CFTypeRef(&self) -> *const c_void[src]
unsafe fn wrap_under_create_rule(
reference: *const __CFDictionary
) -> CFDictionary<K, V>[src]
reference: *const __CFDictionary
) -> CFDictionary<K, V>
fn type_id() -> usize[src]
impl TCFType for CFRunLoopSource[src]
type Ref = *mut __CFRunLoopSource
fn as_concrete_TypeRef(&self) -> *mut __CFRunLoopSource[src]
unsafe fn wrap_under_get_rule(
reference: *mut __CFRunLoopSource
) -> CFRunLoopSource[src]
reference: *mut __CFRunLoopSource
) -> CFRunLoopSource
fn as_CFTypeRef(&self) -> *const c_void[src]
unsafe fn wrap_under_create_rule(
reference: *mut __CFRunLoopSource
) -> CFRunLoopSource[src]
reference: *mut __CFRunLoopSource
) -> CFRunLoopSource