pub struct DynamicStore { /* private fields */ }Implementations§
Source§impl DynamicStore
impl DynamicStore
pub fn type_id() -> u64
pub fn new(name: &str) -> Result<Self>
Sourcepub fn new_with_session_keys(name: &str) -> Result<Self>
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}pub fn new_with_callback<F>(name: &str, callback: F) -> Result<Self>
pub fn new_with_session_keys_and_callback<F>( name: &str, callback: F, ) -> Result<Self>
Sourcepub fn copy_value(&self, key: &str) -> Result<Option<PropertyList>>
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}pub fn copy_multiple<K, P>( &self, keys: &[K], patterns: &[P], ) -> Result<Option<PropertyList>>
pub fn add_value(&self, key: &str, value: &PropertyList) -> Result<()>
pub fn add_temporary_value(&self, key: &str, value: &PropertyList) -> Result<()>
pub fn set_value(&self, key: &str, value: &PropertyList) -> Result<()>
pub fn set_multiple<R, N>( &self, keys_to_set: Option<&PropertyList>, keys_to_remove: &[R], keys_to_notify: &[N], ) -> Result<()>
pub fn remove_value(&self, key: &str) -> Result<()>
pub fn notify_value(&self, key: &str) -> Result<()>
pub fn copy_key_list(&self, pattern: &str) -> Result<Vec<String>>
pub fn set_notification_keys<K, P>( &self, keys: &[K], patterns: &[P], ) -> Result<()>
pub fn create_run_loop_source( &self, order: isize, ) -> Result<DynamicStoreRunLoopSource>
pub fn set_dispatch_queue_global(&self) -> Result<()>
pub fn clear_dispatch_queue(&self) -> Result<()>
pub fn copy_notified_keys(&self) -> Vec<String>
Sourcepub fn computer_name(&self) -> Option<String>
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}Sourcepub fn local_host_name(&self) -> Option<String>
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}Sourcepub fn location(&self) -> Option<String>
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}Sourcepub fn proxies(&self) -> Option<PropertyList>
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}pub fn dhcp_info( &self, service_id: Option<&str>, ) -> Result<Option<PropertyList>>
pub fn dhcp_option_data(info: &PropertyList, code: u8) -> Option<PropertyList>
pub fn dhcp_lease_start_time(info: &PropertyList) -> Option<PropertyList>
pub fn dhcp_lease_expiration_time(info: &PropertyList) -> Option<PropertyList>
pub fn key_create<A: AsRef<str>>( format: &str, arguments: &[A], ) -> Result<String>
Sourcepub fn network_global_entity_key(domain: &str, entity: &str) -> Result<String>
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}pub fn network_interface_key(domain: &str) -> Result<String>
pub fn network_interface_entity_key( domain: &str, interface_name: &str, entity: Option<&str>, ) -> Result<String>
pub fn network_service_entity_key( domain: &str, service_id: &str, entity: Option<&str>, ) -> Result<String>
pub fn computer_name_key() -> Result<String>
pub fn console_user_key() -> Result<String>
pub fn host_names_key() -> Result<String>
pub fn location_key() -> Result<String>
pub fn proxies_key() -> Result<String>
Trait Implementations§
Source§impl Clone for DynamicStore
impl Clone for DynamicStore
Source§fn clone(&self) -> DynamicStore
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DynamicStore
impl RefUnwindSafe for DynamicStore
impl !Send for DynamicStore
impl !Sync for DynamicStore
impl Unpin for DynamicStore
impl UnsafeUnpin for DynamicStore
impl UnwindSafe for DynamicStore
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
Mutably borrows from an owned value. Read more