Skip to main content

systemconfiguration/
lib.rs

1#![cfg_attr(docsrs, feature(doc_cfg))]
2#![allow(
3    clippy::borrow_as_ptr,
4    clippy::doc_markdown,
5    clippy::missing_const_for_fn,
6    clippy::missing_errors_doc,
7    clippy::missing_panics_doc,
8    clippy::module_name_repetitions,
9    clippy::must_use_candidate,
10    clippy::redundant_pub_crate,
11    clippy::similar_names,
12    clippy::use_self
13)]
14#![doc = include_str!("../README.md")]
15
16#[cfg(not(target_os = "macos"))]
17compile_error!("systemconfiguration only supports macOS");
18
19mod bond_interface;
20mod bridge;
21mod captive_network;
22mod console_user;
23mod dynamic_store;
24mod error;
25mod ffi;
26mod network_configuration;
27mod network_connection;
28mod network_interface;
29mod network_protocol;
30mod network_reachability;
31mod network_services;
32mod network_sets;
33mod preferences;
34mod property_list;
35mod schema;
36/// Wraps constants from `SCSchemaDefinitions.h`.
37pub mod schema_definitions;
38mod system_configuration;
39mod vlan_interface;
40
41/// Re-exports the corresponding SystemConfiguration wrappers.
42pub use bond_interface::{BondInterface, BondStatus};
43/// Re-exports the corresponding SystemConfiguration wrappers.
44pub use captive_network::CaptiveNetwork;
45/// Re-exports the corresponding SystemConfiguration wrappers.
46pub use console_user::ConsoleUser;
47/// Re-exports the corresponding SystemConfiguration wrappers.
48pub use dynamic_store::{DynamicStore, DynamicStoreRunLoopSource};
49/// Re-exports the corresponding SystemConfiguration wrappers.
50pub use error::{Result, SystemConfigurationError};
51/// Re-exports the corresponding SystemConfiguration wrappers.
52pub use network_configuration::{NetworkConfiguration, NetworkConfigurationOverview};
53/// Re-exports the corresponding SystemConfiguration wrappers.
54pub use network_connection::{
55    NetworkConnection, NetworkConnectionFlags, NetworkConnectionPppStatus, NetworkConnectionStatus,
56    NetworkConnectionUserPreferences,
57};
58/// Re-exports the corresponding SystemConfiguration wrappers.
59pub use network_interface::{
60    NetworkInterface, NetworkInterfaceMediaOptions, NetworkInterfaceMtuInfo,
61};
62/// Re-exports the corresponding SystemConfiguration wrappers.
63pub use network_protocol::NetworkProtocol;
64/// Re-exports the corresponding SystemConfiguration wrappers.
65pub use network_reachability::{NetworkReachability, Reachability, ReachabilityFlags};
66/// Re-exports the corresponding SystemConfiguration wrappers.
67pub use network_services::NetworkService;
68/// Re-exports the corresponding SystemConfiguration wrappers.
69pub use network_sets::NetworkSet;
70/// Re-exports the corresponding SystemConfiguration wrappers.
71pub use preferences::{Preferences, PreferencesNotification};
72/// Re-exports the corresponding SystemConfiguration wrappers.
73pub use property_list::PropertyList;
74/// Re-exports the corresponding SystemConfiguration wrappers.
75pub use schema::{Schema, SchemaCatalog};
76/// Re-exports the corresponding SystemConfiguration wrappers.
77pub use system_configuration::{SystemConfiguration, SystemConfigurationLastError};
78/// Re-exports the corresponding SystemConfiguration wrappers.
79pub use vlan_interface::VlanInterface;
80
81#[cfg(feature = "raw-ffi")]
82/// Wraps raw SystemConfiguration FFI exports.
83pub mod raw_ffi;
84
85#[cfg(feature = "async")]
86#[cfg_attr(docsrs, doc(cfg(feature = "async")))]
87/// Wraps async SystemConfiguration callback streams.
88pub mod async_api;
89
90/// Re-exports common SystemConfiguration wrapper types.
91pub mod prelude {
92    /// Re-exports the corresponding SystemConfiguration wrappers.
93    pub use crate::{
94        schema_definitions, BondInterface, BondStatus, CaptiveNetwork, ConsoleUser, DynamicStore,
95        DynamicStoreRunLoopSource, NetworkConfiguration, NetworkConfigurationOverview,
96        NetworkConnection, NetworkConnectionFlags, NetworkConnectionPppStatus,
97        NetworkConnectionStatus, NetworkConnectionUserPreferences, NetworkInterface,
98        NetworkInterfaceMediaOptions, NetworkInterfaceMtuInfo, NetworkProtocol,
99        NetworkReachability, NetworkService, NetworkSet, Preferences, PreferencesNotification,
100        PropertyList, Reachability, ReachabilityFlags, Result, Schema, SchemaCatalog,
101        SystemConfiguration, SystemConfigurationError, SystemConfigurationLastError, VlanInterface,
102    };
103}