pub struct ConnectOptions { /* private fields */ }Expand description
Builder for connect_with.
use donglora_client::{ConnectOptions, connect_with};
let dongle = connect_with(
ConnectOptions::default()
.port("/dev/ttyACM0")
.keepalive(false),
).await?;Implementations§
Source§impl ConnectOptions
impl ConnectOptions
Sourcepub fn port(self, path: impl Into<String>) -> Self
pub fn port(self, path: impl Into<String>) -> Self
Explicit serial port path; skips the mux + auto-discovery chain entirely.
Sourcepub fn timeout(self, timeout: Duration) -> Self
pub fn timeout(self, timeout: Duration) -> Self
Per-command timeout for the connect-time PING + GET_INFO + SET_CONFIG (if any). Default is 2 s.
Sourcepub fn config(self, modulation: Modulation) -> Self
pub fn config(self, modulation: Modulation) -> Self
Supply an initial radio config. When paired with auto_configure
(enabled by default via Self::auto_configure), the config is
applied immediately after GET_INFO. Callers that want full
manual control over configuration should leave this as None.
Sourcepub fn auto_configure(self, enabled: bool) -> Self
pub fn auto_configure(self, enabled: bool) -> Self
Whether to apply the Self::config automatically at connect
time. Default: true if a config was supplied, false otherwise.
Source§impl ConnectOptions
Convenience constructor — equivalent to ConnectOptions::default()
but with keepalive = true, matching the Python client’s defaults.
impl ConnectOptions
Convenience constructor — equivalent to ConnectOptions::default()
but with keepalive = true, matching the Python client’s defaults.
Trait Implementations§
Source§impl Clone for ConnectOptions
impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
fn clone(&self) -> ConnectOptions
Returns a duplicate of the value. Read more
1.0.0 · 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 ConnectOptions
impl Debug for ConnectOptions
Source§impl Default for ConnectOptions
impl Default for ConnectOptions
Source§fn default() -> ConnectOptions
fn default() -> ConnectOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ConnectOptions
impl RefUnwindSafe for ConnectOptions
impl Send for ConnectOptions
impl Sync for ConnectOptions
impl Unpin for ConnectOptions
impl UnsafeUnpin for ConnectOptions
impl UnwindSafe for ConnectOptions
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