pub struct SCDynamicStore(_);
Expand description
Access to the key-value pairs in the dynamic store of a running system.
Use the SCDynamicStoreBuilder
to create instances of this.
Implementations§
source§impl SCDynamicStore
impl SCDynamicStore
sourcepub fn get_keys<S: Into<CFString>>(
&self,
pattern: S
) -> Option<CFArray<CFString>>
pub fn get_keys<S: Into<CFString>>( &self, pattern: S ) -> Option<CFArray<CFString>>
Returns the keys that represent the current dynamic store entries that match the specified
pattern. Or None
if an error occured.
pattern
- A regular expression pattern used to match the dynamic store keys.
sourcepub fn get_proxies(&self) -> Option<CFDictionary<CFString, CFType>>
pub fn get_proxies(&self) -> Option<CFDictionary<CFString, CFType>>
Returns the key-value pairs that represent the current internet proxy settings. Or None
if
no proxy settings have been defined or if an error occured.
sourcepub fn get<S: Into<CFString>>(&self, key: S) -> Option<CFPropertyList>
pub fn get<S: Into<CFString>>(&self, key: S) -> Option<CFPropertyList>
If the given key exists in the store, the associated value is returned.
Use CFPropertyList::downcast_into
to cast the result into the correct type.
sourcepub fn set<S: Into<CFString>, V: CFPropertyListSubClass>(
&self,
key: S,
value: V
) -> bool
pub fn set<S: Into<CFString>, V: CFPropertyListSubClass>( &self, key: S, value: V ) -> bool
Sets the value of the given key. Overwrites existing values.
Returns true
on success, false on failure.
sourcepub fn set_raw<S: Into<CFString>>(&self, key: S, value: &CFPropertyList) -> bool
pub fn set_raw<S: Into<CFString>>(&self, key: S, value: &CFPropertyList) -> bool
Sets the value of the given key. Overwrites existing values.
Returns true
on success, false on failure.
sourcepub fn remove<S: Into<CFString>>(&self, key: S) -> bool
pub fn remove<S: Into<CFString>>(&self, key: S) -> bool
Removes the value of the specified key from the dynamic store.
sourcepub fn set_notification_keys<T1, T2>(
&self,
keys: &CFArray<T1>,
patterns: &CFArray<T2>
) -> bool
pub fn set_notification_keys<T1, T2>( &self, keys: &CFArray<T1>, patterns: &CFArray<T2> ) -> bool
Specifies a set of keys and key patterns that should be monitored for changes.
sourcepub fn create_run_loop_source(&self) -> CFRunLoopSource
pub fn create_run_loop_source(&self) -> CFRunLoopSource
Creates a run loop source object that can be added to the application’s run loop.
Trait Implementations§
source§impl Clone for SCDynamicStore
impl Clone for SCDynamicStore
source§fn clone(&self) -> SCDynamicStore
fn clone(&self) -> SCDynamicStore
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Drop for SCDynamicStore
impl Drop for SCDynamicStore
source§impl PartialEq<SCDynamicStore> for SCDynamicStore
impl PartialEq<SCDynamicStore> for SCDynamicStore
source§fn eq(&self, other: &SCDynamicStore) -> bool
fn eq(&self, other: &SCDynamicStore) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl TCFType for SCDynamicStore
impl TCFType for SCDynamicStore
§type Ref = *const __SCDynamicStore
type Ref = *const __SCDynamicStore
source§fn as_concrete_TypeRef(&self) -> SCDynamicStoreRef
fn as_concrete_TypeRef(&self) -> SCDynamicStoreRef
source§unsafe fn wrap_under_get_rule(reference: SCDynamicStoreRef) -> Self
unsafe fn wrap_under_get_rule(reference: SCDynamicStoreRef) -> Self
CFTypeRef
subclass. Use this
when following Core Foundation’s “Get Rule”. The reference count is bumped.source§fn as_CFTypeRef(&self) -> CFTypeRef
fn as_CFTypeRef(&self) -> CFTypeRef
CFTypeRef
. The reference count is not adjusted.source§unsafe fn wrap_under_create_rule(reference: SCDynamicStoreRef) -> Self
unsafe fn wrap_under_create_rule(reference: SCDynamicStoreRef) -> Self
CFTypeRef
subclass. Use this
when following Core Foundation’s “Create Rule”. The reference count is not bumped.source§fn as_CFType(&self) -> CFType
fn as_CFType(&self) -> CFType
CFType
. The reference count is incremented by one.source§fn into_CFType(self) -> CFTypewhere
Self: Sized,
fn into_CFType(self) -> CFTypewhere Self: Sized,
CFType
. Consumes self and avoids changing the reference
count.