Skip to main content

Preferences

Struct Preferences 

Source
pub struct Preferences { /* private fields */ }
Expand description

Re-exports the corresponding SystemConfiguration wrappers. Wraps SCPreferencesRef.

Implementations§

Source§

impl Preferences

Source

pub fn type_id() -> u64

Wraps SCPreferencesGetTypeID.

Source

pub fn new(name: &str, prefs_id: Option<&str>) -> Result<Self>

Wraps SCPreferencesCreate.

Source

pub fn new_with_authorization( name: &str, prefs_id: Option<&str>, ) -> Result<Self>

Wraps SCPreferencesCreateWithAuthorization.

Source

pub unsafe fn new_with_authorization_raw( name: &str, prefs_id: Option<&str>, authorization: Option<NonNull<c_void>>, ) -> Result<Self>

§Safety

authorization must be a valid AuthorizationRef obtained from a compatible Security-framework binding, and it must remain valid for the lifetime requirements imposed by SCPreferences.

Source

pub fn new_with_callback<F>( name: &str, prefs_id: Option<&str>, callback: F, ) -> Result<Self>
where F: FnMut(PreferencesNotification) + Send + 'static,

Wraps SCPreferencesCreate with SCPreferencesSetCallback.

Source

pub fn new_with_authorization_and_callback<F>( name: &str, prefs_id: Option<&str>, callback: F, ) -> Result<Self>
where F: FnMut(PreferencesNotification) + Send + 'static,

Wraps SCPreferencesCreateWithAuthorization with SCPreferencesSetCallback.

Source

pub unsafe fn new_with_authorization_raw_and_callback<F>( name: &str, prefs_id: Option<&str>, authorization: Option<NonNull<c_void>>, callback: F, ) -> Result<Self>
where F: FnMut(PreferencesNotification) + Send + 'static,

§Safety

authorization must be a valid AuthorizationRef obtained from a compatible Security-framework binding, and it must remain valid for the lifetime requirements imposed by SCPreferences.

Source

pub fn set_callback<F>(&mut self, callback: F) -> Result<()>
where F: FnMut(PreferencesNotification) + Send + 'static,

Wraps a helper on SCPreferencesRef.

Source

pub fn clear_callback(&mut self) -> Result<()>

Wraps a helper on SCPreferencesRef.

Source

pub fn schedule_with_run_loop_current(&self) -> Result<()>

Wraps SCPreferencesScheduleWithRunLoopCurrent.

Source

pub fn unschedule_from_run_loop_current(&self) -> Result<()>

Wraps SCPreferencesUnscheduleFromRunLoopCurrent.

Source

pub fn set_dispatch_queue_global(&self) -> Result<()>

Wraps SCPreferencesSetDispatchQueueGlobal.

Source

pub fn clear_dispatch_queue(&self) -> Result<()>

Wraps SCPreferencesClearDispatchQueue.

Source

pub fn lock(&self, wait: bool) -> Result<()>

Wraps SCPreferencesLock.

Source

pub fn commit_changes(&self) -> Result<()>

Wraps SCPreferencesCommitChanges.

Source

pub fn apply_changes(&self) -> Result<()>

Wraps SCPreferencesApplyChanges.

Source

pub fn unlock(&self) -> Result<()>

Wraps SCPreferencesUnlock.

Source

pub fn synchronize(&self)

Wraps SCPreferencesSynchronize.

Source

pub fn signature(&self) -> Option<String>

Wraps SCPreferencesCopySignature.

Source

pub fn copy_key_list(&self) -> Vec<String>

Wraps SCPreferencesCopyKeyList.

Source

pub fn get_value(&self, key: &str) -> Result<Option<PropertyList>>

Wraps SCPreferencesGetValue.

Source

pub fn add_value(&self, key: &str, value: &PropertyList) -> Result<()>

Wraps SCPreferencesAddValue.

Source

pub fn set_value(&self, key: &str, value: &PropertyList) -> Result<()>

Wraps SCPreferencesSetValue.

Source

pub fn remove_value(&self, key: &str) -> Result<()>

Wraps SCPreferencesRemoveValue.

Source

pub fn path_create_unique_child(&self, prefix: &str) -> Result<Option<String>>

Wraps SCPreferencesPathCreateUniqueChild.

Source

pub fn path_get_value(&self, path: &str) -> Result<Option<PropertyList>>

Wraps SCPreferencesPathGetValue.

Wraps SCPreferencesPathGetLink.

Source

pub fn path_set_value(&self, path: &str, value: &PropertyList) -> Result<()>

Wraps SCPreferencesPathSetValue.

Wraps SCPreferencesPathSetLink.

Source

pub fn path_remove_value(&self, path: &str) -> Result<()>

Wraps SCPreferencesPathRemoveValue.

Source

pub fn set_computer_name(&self, name: Option<&str>) -> Result<()>

Wraps SCPreferencesSetComputerName.

Source

pub fn set_local_host_name(&self, name: Option<&str>) -> Result<()>

Wraps SCPreferencesSetLocalHostName.

Source

pub fn network_services(&self) -> Vec<NetworkService>

Wraps a helper on SCPreferencesRef.

Trait Implementations§

Source§

impl Clone for Preferences

Source§

fn clone(&self) -> Preferences

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Preferences

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.