pub struct CFURL(/* private fields */);Expand description
Safe wrapper around a retained Core Foundation CFURL reference.
Implementations§
Source§impl CFURL
impl CFURL
Sourcepub unsafe fn from_raw(ptr: *mut c_void) -> Option<Self>
pub unsafe fn from_raw(ptr: *mut c_void) -> Option<Self>
Adopts a +1 retained CFURL pointer and returns None for null.
§Safety
A non-null ptr must be a live CFURL pointer of the exact dynamic type carrying one retain transferred to this wrapper. The caller must not release or separately adopt that transferred retain.
Sourcepub unsafe fn from_raw_borrowed(ptr: *mut c_void) -> Option<Self>
pub unsafe fn from_raw_borrowed(ptr: *mut c_void) -> Option<Self>
Retains a +0 borrowed CFURL pointer and returns an owned wrapper.
§Safety
A non-null ptr must be a live CFURL pointer of the exact dynamic type for the duration of the retain call.
Sourcepub const fn as_ptr(&self) -> *mut c_void
pub const fn as_ptr(&self) -> *mut c_void
Borrows the raw +0 Core Foundation pointer while self remains alive.
Sourcepub fn into_cf_type(self) -> CFType
pub fn into_cf_type(self) -> CFType
Consumes this wrapper and returns the erased CFType.
Source§impl CFURL
impl CFURL
Sourcepub fn from_string(value: &str) -> Self
pub fn from_string(value: &str) -> Self
Create a URL from an absolute string.
Sourcepub fn from_file_system_path(path: &str, is_directory: bool) -> Self
pub fn from_file_system_path(path: &str, is_directory: bool) -> Self
Create a file URL from a POSIX path.
Sourcepub fn absolute_string(&self) -> CFString
pub fn absolute_string(&self) -> CFString
Absolute string form of the URL.
Sourcepub fn file_system_path(&self) -> CFString
pub fn file_system_path(&self) -> CFString
File-system path (POSIX style) for file URLs.
Sourcepub fn has_directory_path(&self) -> bool
pub fn has_directory_path(&self) -> bool
Whether the URL ends with a directory path separator.