pub struct NetworkService { /* private fields */ }Expand description
Re-exports the corresponding SystemConfiguration wrappers.
Wraps SCNetworkServiceRef.
Implementations§
Source§impl NetworkService
impl NetworkService
Sourcepub fn copy_all(preferences: &Preferences) -> Vec<Self>
pub fn copy_all(preferences: &Preferences) -> Vec<Self>
Wraps SCNetworkServiceCopyAll.
Sourcepub fn create(
preferences: &Preferences,
interface: &NetworkInterface,
) -> Result<Self>
pub fn create( preferences: &Preferences, interface: &NetworkInterface, ) -> Result<Self>
Wraps SCNetworkServiceCreate.
Sourcepub fn copy(preferences: &Preferences, service_id: &str) -> Result<Option<Self>>
pub fn copy(preferences: &Preferences, service_id: &str) -> Result<Option<Self>>
Wraps SCNetworkServiceCopy.
Sourcepub fn copy_protocols(&self) -> Vec<NetworkProtocol>
pub fn copy_protocols(&self) -> Vec<NetworkProtocol>
Wraps SCNetworkServiceCopyProtocols.
Sourcepub fn copy_protocol(
&self,
protocol_type: &str,
) -> Result<Option<NetworkProtocol>>
pub fn copy_protocol( &self, protocol_type: &str, ) -> Result<Option<NetworkProtocol>>
Wraps SCNetworkServiceCopyProtocol.
Sourcepub fn add_protocol_type(&self, protocol_type: &str) -> Result<()>
pub fn add_protocol_type(&self, protocol_type: &str) -> Result<()>
Wraps SCNetworkServiceAddProtocolType.
Sourcepub fn establish_default_configuration(&self) -> Result<()>
pub fn establish_default_configuration(&self) -> Result<()>
Wraps SCNetworkServiceEstablishDefaultConfiguration.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Wraps SCNetworkServiceGetEnabled.
Sourcepub fn interface(&self) -> Option<NetworkInterface>
pub fn interface(&self) -> Option<NetworkInterface>
Wraps SCNetworkServiceCopyInterface.
Sourcepub fn service_id(&self) -> Result<Option<String>>
pub fn service_id(&self) -> Result<Option<String>>
Wraps SCNetworkServiceCopyServiceID.
Sourcepub fn remove_protocol_type(&self, protocol_type: &str) -> Result<()>
pub fn remove_protocol_type(&self, protocol_type: &str) -> Result<()>
Wraps SCNetworkServiceRemoveProtocolType.
Sourcepub fn set_enabled(&self, enabled: bool) -> Result<()>
pub fn set_enabled(&self, enabled: bool) -> Result<()>
Wraps SCNetworkServiceSetEnabled.
Trait Implementations§
Source§impl Clone for NetworkService
impl Clone for NetworkService
Source§fn clone(&self) -> NetworkService
fn clone(&self) -> NetworkService
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 NetworkService
impl RefUnwindSafe for NetworkService
impl !Send for NetworkService
impl !Sync for NetworkService
impl Unpin for NetworkService
impl UnsafeUnpin for NetworkService
impl UnwindSafe for NetworkService
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