pub struct Client { /* private fields */ }Expand description
Main client for interacting with Huawei LTE dongles.
The client handles:
- HTTP connection pooling
- Session management and CSRF tokens
- Automatic retry on transient failures
- Error recovery and session refresh
§Thread Safety
The client is thread-safe and can be shared across multiple tasks using Arc:
use std::sync::Arc;
use huawei_dongle_api::{Client, Config};
let client = Arc::new(Client::new(Config::default())?);
// Clone the Arc for use in multiple tasks
let client2 = client.clone();
tokio::spawn(async move {
let status = client2.monitoring().status().await;
});Implementations§
Source§impl Client
impl Client
Sourcepub fn with_default_config() -> Result<Self>
pub fn with_default_config() -> Result<Self>
Create a client with default configuration
pub fn device(&self) -> DeviceApi<'_>
pub fn monitoring(&self) -> MonitoringApi<'_>
pub fn network(&self) -> NetworkApi<'_>
pub fn sms(&self) -> SmsApi<'_>
pub fn dhcp(&self) -> DhcpApi<'_>
pub fn auth(&self) -> AuthApi<'_>
pub fn base_url(&self) -> &Url
pub fn config(&self) -> &Config
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
impl !UnwindSafe for Client
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