Skip to main content

DynamicStore

Struct DynamicStore 

Source
pub struct DynamicStore { /* private fields */ }

Implementations§

Source§

impl DynamicStore

Source

pub fn type_id() -> u64

Source

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

Source

pub fn new_with_session_keys(name: &str) -> Result<Self>

Examples found in repository?
examples/01_dynamic_store_overview.rs (line 4)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4    let store = DynamicStore::new_with_session_keys("systemconfiguration-rs.dynamic-store-example")?;
5    println!("computer_name={:?}", store.computer_name());
6    println!("local_host_name={:?}", store.local_host_name());
7    println!("location={:?}", store.location());
8
9    let global_ipv4 = DynamicStore::network_global_entity_key("State", "IPv4")?;
10    println!(
11        "global_ipv4={:?}",
12        store.copy_value(&global_ipv4)?.map(|value| value.description()).transpose()?
13    );
14    println!("proxies_present={}", store.proxies().is_some());
15    Ok(())
16}
Source

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

Source

pub fn new_with_session_keys_and_callback<F>( name: &str, callback: F, ) -> Result<Self>
where F: FnMut(Vec<String>) + Send + 'static,

Source

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

Examples found in repository?
examples/01_dynamic_store_overview.rs (line 12)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4    let store = DynamicStore::new_with_session_keys("systemconfiguration-rs.dynamic-store-example")?;
5    println!("computer_name={:?}", store.computer_name());
6    println!("local_host_name={:?}", store.local_host_name());
7    println!("location={:?}", store.location());
8
9    let global_ipv4 = DynamicStore::network_global_entity_key("State", "IPv4")?;
10    println!(
11        "global_ipv4={:?}",
12        store.copy_value(&global_ipv4)?.map(|value| value.description()).transpose()?
13    );
14    println!("proxies_present={}", store.proxies().is_some());
15    Ok(())
16}
Source

pub fn copy_multiple<K, P>( &self, keys: &[K], patterns: &[P], ) -> Result<Option<PropertyList>>
where K: AsRef<str>, P: AsRef<str>,

Source

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

Source

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

Source

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

Source

pub fn set_multiple<R, N>( &self, keys_to_set: Option<&PropertyList>, keys_to_remove: &[R], keys_to_notify: &[N], ) -> Result<()>
where R: AsRef<str>, N: AsRef<str>,

Source

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

Source

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

Source

pub fn copy_key_list(&self, pattern: &str) -> Result<Vec<String>>

Source

pub fn set_notification_keys<K, P>( &self, keys: &[K], patterns: &[P], ) -> Result<()>
where K: AsRef<str>, P: AsRef<str>,

Source

pub fn create_run_loop_source( &self, order: isize, ) -> Result<DynamicStoreRunLoopSource>

Source

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

Source

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

Source

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

Source

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

Examples found in repository?
examples/01_dynamic_store_overview.rs (line 5)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4    let store = DynamicStore::new_with_session_keys("systemconfiguration-rs.dynamic-store-example")?;
5    println!("computer_name={:?}", store.computer_name());
6    println!("local_host_name={:?}", store.local_host_name());
7    println!("location={:?}", store.location());
8
9    let global_ipv4 = DynamicStore::network_global_entity_key("State", "IPv4")?;
10    println!(
11        "global_ipv4={:?}",
12        store.copy_value(&global_ipv4)?.map(|value| value.description()).transpose()?
13    );
14    println!("proxies_present={}", store.proxies().is_some());
15    Ok(())
16}
Source

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

Examples found in repository?
examples/01_dynamic_store_overview.rs (line 6)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4    let store = DynamicStore::new_with_session_keys("systemconfiguration-rs.dynamic-store-example")?;
5    println!("computer_name={:?}", store.computer_name());
6    println!("local_host_name={:?}", store.local_host_name());
7    println!("location={:?}", store.location());
8
9    let global_ipv4 = DynamicStore::network_global_entity_key("State", "IPv4")?;
10    println!(
11        "global_ipv4={:?}",
12        store.copy_value(&global_ipv4)?.map(|value| value.description()).transpose()?
13    );
14    println!("proxies_present={}", store.proxies().is_some());
15    Ok(())
16}
Source

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

Examples found in repository?
examples/01_dynamic_store_overview.rs (line 7)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4    let store = DynamicStore::new_with_session_keys("systemconfiguration-rs.dynamic-store-example")?;
5    println!("computer_name={:?}", store.computer_name());
6    println!("local_host_name={:?}", store.local_host_name());
7    println!("location={:?}", store.location());
8
9    let global_ipv4 = DynamicStore::network_global_entity_key("State", "IPv4")?;
10    println!(
11        "global_ipv4={:?}",
12        store.copy_value(&global_ipv4)?.map(|value| value.description()).transpose()?
13    );
14    println!("proxies_present={}", store.proxies().is_some());
15    Ok(())
16}
Source

pub fn proxies(&self) -> Option<PropertyList>

Examples found in repository?
examples/01_dynamic_store_overview.rs (line 14)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4    let store = DynamicStore::new_with_session_keys("systemconfiguration-rs.dynamic-store-example")?;
5    println!("computer_name={:?}", store.computer_name());
6    println!("local_host_name={:?}", store.local_host_name());
7    println!("location={:?}", store.location());
8
9    let global_ipv4 = DynamicStore::network_global_entity_key("State", "IPv4")?;
10    println!(
11        "global_ipv4={:?}",
12        store.copy_value(&global_ipv4)?.map(|value| value.description()).transpose()?
13    );
14    println!("proxies_present={}", store.proxies().is_some());
15    Ok(())
16}
Source

pub fn dhcp_info( &self, service_id: Option<&str>, ) -> Result<Option<PropertyList>>

Source

pub fn dhcp_option_data(info: &PropertyList, code: u8) -> Option<PropertyList>

Source

pub fn dhcp_lease_start_time(info: &PropertyList) -> Option<PropertyList>

Source

pub fn dhcp_lease_expiration_time(info: &PropertyList) -> Option<PropertyList>

Source

pub fn key_create<A: AsRef<str>>( format: &str, arguments: &[A], ) -> Result<String>

Source

pub fn network_global_entity_key(domain: &str, entity: &str) -> Result<String>

Examples found in repository?
examples/01_dynamic_store_overview.rs (line 9)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4    let store = DynamicStore::new_with_session_keys("systemconfiguration-rs.dynamic-store-example")?;
5    println!("computer_name={:?}", store.computer_name());
6    println!("local_host_name={:?}", store.local_host_name());
7    println!("location={:?}", store.location());
8
9    let global_ipv4 = DynamicStore::network_global_entity_key("State", "IPv4")?;
10    println!(
11        "global_ipv4={:?}",
12        store.copy_value(&global_ipv4)?.map(|value| value.description()).transpose()?
13    );
14    println!("proxies_present={}", store.proxies().is_some());
15    Ok(())
16}
Source

pub fn network_interface_key(domain: &str) -> Result<String>

Source

pub fn network_interface_entity_key( domain: &str, interface_name: &str, entity: Option<&str>, ) -> Result<String>

Source

pub fn network_service_entity_key( domain: &str, service_id: &str, entity: Option<&str>, ) -> Result<String>

Source

pub fn computer_name_key() -> Result<String>

Source

pub fn console_user_key() -> Result<String>

Source

pub fn host_names_key() -> Result<String>

Source

pub fn location_key() -> Result<String>

Source

pub fn proxies_key() -> Result<String>

Trait Implementations§

Source§

impl Clone for DynamicStore

Source§

fn clone(&self) -> DynamicStore

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 DynamicStore

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.