Struct hueclient::UnauthBridge
source · pub struct UnauthBridge {
pub ip: IpAddr,
/* private fields */
}
Expand description
An unauthenticated bridge is a bridge that has not
Fields§
§ip: IpAddr
The IP-address of the bridge.
Implementations§
source§impl UnauthBridge
impl UnauthBridge
sourcepub fn with_user(self, username: impl Into<String>) -> Bridge
pub fn with_user(self, username: impl Into<String>) -> Bridge
Consumes the bridge and returns a new one with a configured username.
Example
let bridge = hueclient::Bridge::for_ip([192u8, 168, 0, 4])
.with_user("rVV05G0i52vQMMLn6BK3dpr0F3uDiqtDjPLPK2uj");
sourcepub fn register_user(self, devicetype: &str) -> Result<Bridge>
pub fn register_user(self, devicetype: &str) -> Result<Bridge>
This function registers a new user at the provided brige, using devicetype
as an
identifier for that user. It returns an error if the button of the bridge was not pressed
shortly before running this function.
Example
let mut bridge = hueclient::Bridge::for_ip([192u8, 168, 0, 4]);
let password = bridge.register_user("mylaptop").unwrap();
// now this password can be stored and reused
Trait Implementations§
source§impl Clone for UnauthBridge
impl Clone for UnauthBridge
source§fn clone(&self) -> UnauthBridge
fn clone(&self) -> UnauthBridge
Returns a copy 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 more