#[repr(C)]pub struct ODQueryRef { /* private fields */ }
CFOpenDirectory
only.Expand description
Opaque reference for the ODQuery object
See also Apple’s documentation
Implementations§
Source§impl ODQueryRef
impl ODQueryRef
Sourcepub unsafe fn with_node(
allocator: Option<&CFAllocator>,
node: Option<&ODNodeRef>,
record_type_or_list: Option<&CFType>,
attribute: Option<&ODAttributeType>,
match_type: ODMatchType,
query_value_or_list: Option<&CFType>,
return_attribute_or_list: Option<&CFType>,
max_results: CFIndex,
error: *mut *mut CFError,
) -> Option<CFRetained<ODQueryRef>>
Available on crate features CFODQuery
and CFOpenDirectoryConstants
and objc2-core-foundation
only.
pub unsafe fn with_node( allocator: Option<&CFAllocator>, node: Option<&ODNodeRef>, record_type_or_list: Option<&CFType>, attribute: Option<&ODAttributeType>, match_type: ODMatchType, query_value_or_list: Option<&CFType>, return_attribute_or_list: Option<&CFType>, max_results: CFIndex, error: *mut *mut CFError, ) -> Option<CFRetained<ODQueryRef>>
CFODQuery
and CFOpenDirectoryConstants
and objc2-core-foundation
only.Creates a query with the node using the parameters provided
Creates a query with the node using the supplied query parameters. Some parameters can either be CFString or CFData or a CFArray of either CFString or CFData.
Parameter allocator
: a memory allocator to use for this object
Parameter node
: an ODNodeRef to use
Parameter recordTypeOrList
: a CFString of a type or CFArray with a list of record types
Parameter attribute
: a CFStringRef of the attribute name to query
Parameter matchType
: an ODMatchType value that signifies the type of query
Parameter queryValueOrList
: a CFStringRef, CFDataRef or CFArrayRef of either type for values to query in attribute
Parameter returnAttributeOrList
: a CFStringRef or CFArrayRef of CFStrings with the list of attributes to be returned
from the query. Passing NULL is equivalent to passing kODAttributeTypeStandardOnly.
Parameter maxResults
: a CFIndex of the total number of values the caller wants to be returned
Parameter error
: an optional CFErrorRef reference for error details
Returns: an ODQueryRef which should be passed into ODQueryCopyResults for immediate results or ODQueryScheduleWithRunLoop for background behavior
Sourcepub unsafe fn with_node_type(
allocator: Option<&CFAllocator>,
node_type: ODNodeType,
record_type_or_list: Option<&CFType>,
attribute: Option<&ODAttributeType>,
match_type: ODMatchType,
query_value_or_list: Option<&CFType>,
return_attribute_or_list: Option<&CFType>,
max_results: CFIndex,
error: *mut *mut CFError,
) -> Option<CFRetained<ODQueryRef>>
Available on crate features CFODQuery
and CFOpenDirectoryConstants
and objc2-core-foundation
only.
pub unsafe fn with_node_type( allocator: Option<&CFAllocator>, node_type: ODNodeType, record_type_or_list: Option<&CFType>, attribute: Option<&ODAttributeType>, match_type: ODMatchType, query_value_or_list: Option<&CFType>, return_attribute_or_list: Option<&CFType>, max_results: CFIndex, error: *mut *mut CFError, ) -> Option<CFRetained<ODQueryRef>>
CFODQuery
and CFOpenDirectoryConstants
and objc2-core-foundation
only.Creates a query object that is initialized to a particular node type.
Creates a query object that is initialized to a particular node type using the supplied query options.
Parameter allocator
: a memory allocator to use for this object
Parameter nodeType
: an ODNodeType to use when doing a query
Parameter recordTypeOrList
: a ODRecordType of a type or CFArray with a list of record types
Parameter attribute
: a ODAttributeType or CFStringRef of the attribute name to query
Parameter matchType
: an ODMatchType value that signifies the type of query
Parameter queryValueOrList
: a CFStringRef, CFDataRef or CFArrayRef of either type for values to query in attribute
Parameter returnAttributeOrList
: a CFStringRef or CFArrayRef of CFStrings with the list of attributes to be returned
from the query. Passing NULL is equivalent to passing kODAttributeTypeStandardOnly.
Parameter maxResults
: a CFIndex of the total number of values the caller wants to be returned
Parameter error
: an optional CFErrorRef reference for error details
Returns: an ODQueryRef which should be passed into ODQueryCopyResults for immediate results or ODQueryScheduleWithRunLoop for background behavior, see ODQueryCallback for details on RunLoop behavior.
Sourcepub unsafe fn results(
self: &ODQueryRef,
allow_partial_results: bool,
error: *mut *mut CFError,
) -> Option<CFRetained<CFArray>>
Available on crate features CFODQuery
and objc2-core-foundation
only.
pub unsafe fn results( self: &ODQueryRef, allow_partial_results: bool, error: *mut *mut CFError, ) -> Option<CFRetained<CFArray>>
CFODQuery
and objc2-core-foundation
only.Returns results from a provided ODQueryRef synchronously
Returns results from a provided ODQueryRef synchronously. Passing false to inAllowPartialResults will block the call until all results are returned or an error occurs. true can be passed at any time even if previous calls were made with false.
Parameter query
: an ODQueryRef to use
Parameter allowPartialResults
: a bool, passing true to retrieve any currently available results, or false to
wait for all results
Parameter error
: an optional CFErrorRef reference for error details
Returns: a CFArrayRef comprised of ODRecord objects. If partial results were requested but are complete, then NULL will be returned with outError set to NULL. If an error occurs, NULL will be returned and outError should be checked accordingly.
Sourcepub unsafe fn synchronize(self: &ODQueryRef)
Available on crate feature CFODQuery
only.
pub unsafe fn synchronize(self: &ODQueryRef)
CFODQuery
only.Will dispose of any results and restart the query.
Will dispose of any results and restart the query for subsequent ODQueryCopyResults. If the query is currently scheduled on a RunLoop, then the callback function will be called with inResults == NULL and inError.error == kODErrorQuerySynchronize and inError.domain == kODErrorDomainFramework, signifying that all existing results should be thrown away in preparation for new results.
Parameter query
: an ODQueryRef to use
Sourcepub unsafe fn set_callback(
self: &ODQueryRef,
callback: ODQueryCallback,
user_info: *mut c_void,
)
Available on crate features CFODQuery
and objc2-core-foundation
only.
pub unsafe fn set_callback( self: &ODQueryRef, callback: ODQueryCallback, user_info: *mut c_void, )
CFODQuery
and objc2-core-foundation
only.This call is used to set the callback function for an asynchronous query
This call is used to set the callback function for an asynchronous query, using a CFRunLoop or a dispatch queue.
Parameter query
: an ODQueryRef to use
Parameter callback
: a function to call when a query has results to return
Parameter userInfo
: a user-defined pointer to be passed back to the Query callback function
Sourcepub unsafe fn schedule_with_run_loop(
self: &ODQueryRef,
run_loop: Option<&CFRunLoop>,
run_loop_mode: Option<&CFString>,
)
Available on crate features CFODQuery
and objc2-core-foundation
only.
pub unsafe fn schedule_with_run_loop( self: &ODQueryRef, run_loop: Option<&CFRunLoop>, run_loop_mode: Option<&CFString>, )
CFODQuery
and objc2-core-foundation
only.Allows a query to run off of a runloop, though it will spawn a thread to handle the work
Allows a query to run off of a runloop, though it will spawn a thread to handle the work. When query is complete or stopped the callback function will be called with NULL results and inError set to NULL. ODQueryUnscheduleFromRunLoop() must be called to remove this query from Runloops if necessary.
Parameter query
: an ODQueryRef to put on the runloop
Parameter runLoop
: a CFRunLoopRef to put the ODQueryRef source onto
Parameter runLoopMode
: a CFStringRef with the runloop mode to add the ODQueryRef to
Sourcepub unsafe fn unschedule_from_run_loop(
self: &ODQueryRef,
run_loop: Option<&CFRunLoop>,
run_loop_mode: Option<&CFString>,
)
Available on crate features CFODQuery
and objc2-core-foundation
only.
pub unsafe fn unschedule_from_run_loop( self: &ODQueryRef, run_loop: Option<&CFRunLoop>, run_loop_mode: Option<&CFString>, )
CFODQuery
and objc2-core-foundation
only.Removes the ODQueryRef from the provided runloop
Removes the ODQueryRef from the provided runloop
Parameter query
: an ODQueryRef to remove from the runloop
Parameter runLoop
: a CFRunLoopRef to remove the ODQuery source from
Parameter runLoopMode
: a CFStringRef of the mode to remove the ODQuery from
Sourcepub unsafe fn set_dispatch_queue(
self: &ODQueryRef,
queue: Option<&DispatchQueue>,
)
Available on crate features CFODQuery
and dispatch2
only.
pub unsafe fn set_dispatch_queue( self: &ODQueryRef, queue: Option<&DispatchQueue>, )
CFODQuery
and dispatch2
only.Performs the query and sends the results using the specified dispatch queue
Schedule the query to run and deliver its results using the specified dispatch queue. The previously set callback will be called using the same semantics as ODQueryScheduleWithRunLoop
Parameter query
: an ODQueryRef to perform
Parameter queue
: a dispatch queue to receive the query results
Methods from Deref<Target = CFType>§
Sourcepub fn downcast_ref<T>(&self) -> Option<&T>where
T: ConcreteType,
pub fn downcast_ref<T>(&self) -> Option<&T>where
T: ConcreteType,
Attempt to downcast the type to that of type T
.
This is the reference-variant. Use CFRetained::downcast
if you
want to convert a retained type. See also ConcreteType
for more
details on which types support being converted to.
Sourcepub fn retain_count(&self) -> usize
pub fn retain_count(&self) -> usize
Get the reference count of the object.
This function may be useful for debugging. You normally do not use this function otherwise.
Beware that some things (like CFNumber
s, small CFString
s etc.) may
not have a normal retain count for optimization purposes, and can
return usize::MAX
in that case.
Trait Implementations§
Source§impl AsRef<AnyObject> for ODQueryRef
impl AsRef<AnyObject> for ODQueryRef
Source§impl AsRef<CFType> for ODQueryRef
impl AsRef<CFType> for ODQueryRef
Source§impl AsRef<ODQueryRef> for ODQueryRef
impl AsRef<ODQueryRef> for ODQueryRef
Source§impl Borrow<AnyObject> for ODQueryRef
impl Borrow<AnyObject> for ODQueryRef
Source§impl Borrow<CFType> for ODQueryRef
impl Borrow<CFType> for ODQueryRef
Source§impl ConcreteType for ODQueryRef
Available on crate features CFODQuery
and objc2-core-foundation
only.
impl ConcreteType for ODQueryRef
CFODQuery
and objc2-core-foundation
only.Source§impl Debug for ODQueryRef
impl Debug for ODQueryRef
Source§impl Deref for ODQueryRef
impl Deref for ODQueryRef
Source§impl Hash for ODQueryRef
impl Hash for ODQueryRef
Source§impl Message for ODQueryRef
impl Message for ODQueryRef
Source§impl PartialEq for ODQueryRef
impl PartialEq for ODQueryRef
Source§impl RefEncode for ODQueryRef
impl RefEncode for ODQueryRef
Source§const ENCODING_REF: Encoding
const ENCODING_REF: Encoding
Source§impl Type for ODQueryRef
impl Type for ODQueryRef
Source§fn retain(&self) -> CFRetained<Self>where
Self: Sized,
fn retain(&self) -> CFRetained<Self>where
Self: Sized,
Source§fn as_concrete_TypeRef(&self) -> &Self
fn as_concrete_TypeRef(&self) -> &Self
core-foundation
crate.Source§unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
core-foundation
crate. Read moreSource§fn as_CFTypeRef(&self) -> &CFType
fn as_CFTypeRef(&self) -> &CFType
core-foundation
crate.Source§unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
core-foundation
crate. Read more