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 async fn register_application(self, name: &str) -> Result<Bridge>
pub async fn register_application(self, name: &str) -> Result<Bridge>
This function registers a new application at the provided bridge, using name
as an
identifier for that app. 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 auth_bridge = bridge.register_application("mylaptop").await.unwrap();
let key = auth_bridge.application_key;
// now this key 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 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 moreAuto Trait Implementations§
impl Freeze for UnauthBridge
impl !RefUnwindSafe for UnauthBridge
impl Send for UnauthBridge
impl Sync for UnauthBridge
impl Unpin for UnauthBridge
impl !UnwindSafe for UnauthBridge
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