pub struct DeviceConfig {
pub dev_id: String,
pub address: String,
pub local_key: String,
pub version: f32,
pub port: u16,
}Expand description
Connection parameters for a Tuya device over local network.
§Examples
use tuya_rs::connection::DeviceConfig;
let config = DeviceConfig {
dev_id: "my_device_id".into(),
address: "192.168.1.100".into(),
local_key: "0123456789abcdef".into(),
..Default::default()
};
assert_eq!(config.version, 3.3);
assert_eq!(config.port, 6668);Fields§
§dev_id: StringTuya device ID (devId).
address: StringDevice IP address on local network.
local_key: StringAES-128 local key (16 ASCII characters).
version: f32Protocol version (default 3.3).
port: u16TCP port (default 6668).
Implementations§
Source§impl DeviceConfig
impl DeviceConfig
Trait Implementations§
Source§impl Clone for DeviceConfig
impl Clone for DeviceConfig
Source§fn clone(&self) -> DeviceConfig
fn clone(&self) -> DeviceConfig
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 DeviceConfig
impl Debug for DeviceConfig
Source§impl Default for DeviceConfig
impl Default for DeviceConfig
Source§fn default() -> DeviceConfig
fn default() -> DeviceConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DeviceConfig
impl RefUnwindSafe for DeviceConfig
impl Send for DeviceConfig
impl Sync for DeviceConfig
impl Unpin for DeviceConfig
impl UnsafeUnpin for DeviceConfig
impl UnwindSafe for DeviceConfig
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