pub struct NetworkProtocol { /* private fields */ }Implementations§
Source§impl NetworkProtocol
impl NetworkProtocol
pub fn type_id() -> u64
Sourcepub fn configuration(&self) -> Option<PropertyList>
pub fn configuration(&self) -> Option<PropertyList>
Examples found in repository?
examples/09_network_protocol.rs (line 14)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let prefs = Preferences::new("systemconfiguration-rs.network-protocol-example", None)?;
5 if let Some(protocol) = NetworkService::copy_all(&prefs)
6 .into_iter()
7 .flat_map(|service| service.copy_protocols())
8 .next()
9 {
10 println!(
11 "protocol_type={:?} enabled={} has_config={}",
12 protocol.protocol_type(),
13 protocol.is_enabled(),
14 protocol.configuration().is_some()
15 );
16 } else {
17 println!("no network protocols available");
18 }
19 Ok(())
20}Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Examples found in repository?
examples/09_network_protocol.rs (line 13)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let prefs = Preferences::new("systemconfiguration-rs.network-protocol-example", None)?;
5 if let Some(protocol) = NetworkService::copy_all(&prefs)
6 .into_iter()
7 .flat_map(|service| service.copy_protocols())
8 .next()
9 {
10 println!(
11 "protocol_type={:?} enabled={} has_config={}",
12 protocol.protocol_type(),
13 protocol.is_enabled(),
14 protocol.configuration().is_some()
15 );
16 } else {
17 println!("no network protocols available");
18 }
19 Ok(())
20}Sourcepub fn protocol_type(&self) -> Option<String>
pub fn protocol_type(&self) -> Option<String>
Examples found in repository?
examples/09_network_protocol.rs (line 12)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let prefs = Preferences::new("systemconfiguration-rs.network-protocol-example", None)?;
5 if let Some(protocol) = NetworkService::copy_all(&prefs)
6 .into_iter()
7 .flat_map(|service| service.copy_protocols())
8 .next()
9 {
10 println!(
11 "protocol_type={:?} enabled={} has_config={}",
12 protocol.protocol_type(),
13 protocol.is_enabled(),
14 protocol.configuration().is_some()
15 );
16 } else {
17 println!("no network protocols available");
18 }
19 Ok(())
20}pub fn set_configuration(&self, value: &PropertyList) -> Result<()>
pub fn set_enabled(&self, enabled: bool) -> Result<()>
Trait Implementations§
Source§impl Clone for NetworkProtocol
impl Clone for NetworkProtocol
Source§fn clone(&self) -> NetworkProtocol
fn clone(&self) -> NetworkProtocol
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 NetworkProtocol
impl RefUnwindSafe for NetworkProtocol
impl !Send for NetworkProtocol
impl !Sync for NetworkProtocol
impl Unpin for NetworkProtocol
impl UnsafeUnpin for NetworkProtocol
impl UnwindSafe for NetworkProtocol
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