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
§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.source§impl<'a> ToVoid<SCDynamicStore> for &'a SCDynamicStore
impl<'a> ToVoid<SCDynamicStore> for &'a SCDynamicStore
source§impl ToVoid<SCDynamicStore> for SCDynamicStoreRef
impl ToVoid<SCDynamicStore> for SCDynamicStoreRef
source§impl ToVoid<SCDynamicStore> for SCDynamicStore
impl ToVoid<SCDynamicStore> for SCDynamicStore
impl ConcreteCFType for SCDynamicStore
impl Eq for SCDynamicStore
Auto Trait Implementations§
impl Freeze for SCDynamicStore
impl RefUnwindSafe for SCDynamicStore
impl !Send for SCDynamicStore
impl !Sync for SCDynamicStore
impl Unpin for SCDynamicStore
impl UnwindSafe for SCDynamicStore
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)