pub unsafe trait Type {
// Provided methods
fn retain(&self) -> CFRetained<Self> ⓘ
where Self: Sized { ... }
fn as_concrete_TypeRef(&self) -> &Self { ... }
unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self> ⓘ
where Self: Sized { ... }
fn as_CFTypeRef(&self) -> &CFType
where Self: AsRef<CFType> { ... }
unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self> ⓘ
where Self: Sized { ... }
}
Expand description
A CoreFoundation-like type.
This trait is implemented for all CoreFoundation-like types (i.e. both
types in this crate like CFString
, but also types from other frameworks
like CGColor
from CoreGraphics).
This trait allows the type to be used in CFRetained
.
You should not need to implement this yourself.
§Safety
- The type must be a CoreFoundation-like type.
- The type must be safe to retain/release using
CFRetain
andCFRelease
.
Provided Methods§
Sourcefn retain(&self) -> CFRetained<Self> ⓘwhere
Self: Sized,
fn retain(&self) -> CFRetained<Self> ⓘwhere
Self: Sized,
Increment the reference count of the receiver.
This extends the duration in which the receiver is alive by detaching it from the lifetime information carried by the reference.
This is similar to using Clone
on CFRetained<Self>
,
with the addition that it can be used on a plain reference.
Sourcefn as_concrete_TypeRef(&self) -> &Self
👎Deprecated: this is redundant
fn as_concrete_TypeRef(&self) -> &Self
Helper for easier transition from the core-foundation
crate.
Sourceunsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self> ⓘwhere
Self: Sized,
👎Deprecated: use CFRetained::retain
unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self> ⓘwhere
Self: Sized,
Sourcefn as_CFTypeRef(&self) -> &CFType
👎Deprecated: this is redundant (CF types deref to CFType)
fn as_CFTypeRef(&self) -> &CFType
Helper for easier transition from the core-foundation
crate.
Sourceunsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self> ⓘwhere
Self: Sized,
👎Deprecated: use CFRetained::from_raw
unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self> ⓘwhere
Self: Sized,
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§
impl Type for CFAllocator
impl Type for CFAttributedString
CFAttributedString
only.impl Type for CFBitVector
CFBitVector
only.impl Type for CFBoolean
CFNumber
only.impl Type for CFBundle
CFBundle
only.impl Type for CFCalendar
CFCalendar
only.impl Type for CFCharacterSet
CFCharacterSet
only.impl Type for CFData
CFData
only.impl Type for CFDate
CFDate
only.impl Type for CFDateFormatter
CFDateFormatter
only.impl Type for CFError
CFError
only.impl Type for CFFileDescriptor
CFFileDescriptor
only.impl Type for CFFileSecurity
CFFileSecurity
only.impl Type for CFLocale
CFLocale
only.impl Type for CFMachPort
CFMachPort
only.impl Type for CFMessagePort
CFMessagePort
only.impl Type for CFMutableAttributedString
CFAttributedString
only.impl Type for CFMutableBitVector
CFBitVector
only.impl Type for CFMutableCharacterSet
CFCharacterSet
only.impl Type for CFMutableData
CFData
only.impl Type for CFMutableString
impl Type for CFNotificationCenter
CFNotificationCenter
only.impl Type for CFNull
impl Type for CFNumber
CFNumber
only.impl Type for CFNumberFormatter
CFNumberFormatter
only.impl Type for CFPlugIn
CFBundle
only.impl Type for CFPlugInInstance
CFPlugIn
only.impl Type for CFReadStream
CFStream
only.impl Type for CFRunLoop
CFRunLoop
only.impl Type for CFRunLoopObserver
CFRunLoop
only.impl Type for CFRunLoopSource
CFRunLoop
only.impl Type for CFRunLoopTimer
CFRunLoop
only.impl Type for CFSocket
CFSocket
only.impl Type for CFString
impl Type for CFStringTokenizer
CFStringTokenizer
only.impl Type for CFTimeZone
CFDate
only.impl Type for CFTree
CFTree
only.impl Type for CFType
impl Type for CFURL
CFURL
only.impl Type for CFURLEnumerator
CFURLEnumerator
only.impl Type for CFUUID
CFUUID
only.impl Type for CFUserNotification
CFUserNotification
only.impl Type for CFWriteStream
CFStream
only.impl Type for CFXMLNode
CFXMLNode
only.impl Type for CFXMLParser
CFXMLParser
only.impl<K: ?Sized, V: ?Sized> Type for CFDictionary<K, V>
CFDictionary
only.impl<K: ?Sized, V: ?Sized> Type for CFMutableDictionary<K, V>
CFDictionary
only.impl<T: ?Sized> Type for CFArray<T>
CFArray
only.impl<T: ?Sized> Type for CFBag<T>
CFBag
only.impl<T: ?Sized> Type for CFBinaryHeap<T>
CFBinaryHeap
only.impl<T: ?Sized> Type for CFMutableArray<T>
CFArray
only.impl<T: ?Sized> Type for CFMutableBag<T>
CFBag
only.impl<T: ?Sized> Type for CFMutableSet<T>
CFSet
only.impl<T: ?Sized> Type for CFSet<T>
CFSet
only.