pub struct SCDynamicStore(/* private fields */);
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 for SCDynamicStore
impl PartialEq for SCDynamicStore
Source§impl TCFType for SCDynamicStore
impl TCFType for SCDynamicStore
Source§type Ref = *const __SCDynamicStore
type Ref = *const __SCDynamicStore
Source§fn as_concrete_TypeRef(&self) -> SCDynamicStoreRef
fn as_concrete_TypeRef(&self) -> SCDynamicStoreRef
TypeRef
.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.Source§fn retain_count(&self) -> isize
fn retain_count(&self) -> isize
Source§fn instance_of<OtherCFType>(&self) -> boolwhere
OtherCFType: TCFType,
fn instance_of<OtherCFType>(&self) -> boolwhere
OtherCFType: TCFType,
true
if this value is an instance of another type.