#[non_exhaustive]pub struct ConnectionOptions {
pub autoconnect: bool,
pub autoconnect_priority: Option<i32>,
pub autoconnect_retries: Option<i32>,
}Expand description
Connection options for saved NetworkManager connections.
Controls how NetworkManager handles saved connection profiles, including automatic connection behavior.
§Examples
use nmrs::ConnectionOptions;
// Basic auto-connect (using defaults)
let opts = ConnectionOptions::default();
// High-priority connection with retry limit
let opts_priority = ConnectionOptions::new(true)
.with_priority(10) // Higher = more preferred
.with_retries(3); // Retry up to 3 times
// Manual connection only
let opts_manual = ConnectionOptions::new(false);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.autoconnect: boolWhether to automatically connect when available
autoconnect_priority: Option<i32>Priority for auto-connection (higher = more preferred)
autoconnect_retries: Option<i32>Maximum number of auto-connect retry attempts
Implementations§
Source§impl ConnectionOptions
impl ConnectionOptions
Sourcepub fn new(autoconnect: bool) -> Self
pub fn new(autoconnect: bool) -> Self
Creates new ConnectionOptions with the specified autoconnect setting.
§Examples
use nmrs::ConnectionOptions;
let opts = ConnectionOptions::new(true);Sourcepub fn with_priority(self, priority: i32) -> Self
pub fn with_priority(self, priority: i32) -> Self
Sets the auto-connection priority.
Sourcepub fn with_retries(self, retries: i32) -> Self
pub fn with_retries(self, retries: i32) -> Self
Sets the maximum number of auto-connect retry attempts.
Trait Implementations§
Source§impl Clone for ConnectionOptions
impl Clone for ConnectionOptions
Source§fn clone(&self) -> ConnectionOptions
fn clone(&self) -> ConnectionOptions
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 moreSource§impl Debug for ConnectionOptions
impl Debug for ConnectionOptions
Auto Trait Implementations§
impl Freeze for ConnectionOptions
impl RefUnwindSafe for ConnectionOptions
impl Send for ConnectionOptions
impl Sync for ConnectionOptions
impl Unpin for ConnectionOptions
impl UnsafeUnpin for ConnectionOptions
impl UnwindSafe for ConnectionOptions
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