[][src]Struct hap::transport::IpTransport

pub struct IpTransport<S: Storage> { /* fields omitted */ }

Transport via TCP/IP.

Methods

impl IpTransport<FileStorage>[src]

pub fn new(config: Config) -> Result<IpTransport<FileStorage>, Error>[src]

Creates a new IpTransport.

Examples

use hap::{
    accessory::{bridge, lightbulb, Category, Information},
    transport::{IpTransport, Transport},
    Config,
};

let config = Config {
    pin: "11122333".into(),
    name: "Acme Lighting".into(),
    category: Category::Bridge,
    ..Default::default()
};

let bridge_info = Information {
    name: "Bridge".into(),
    ..Default::default()
};
let first_bulb_info = Information {
    name: "Bulb 1".into(),
    ..Default::default()
};
let second_bulb_info = Information {
    name: "Bulb 2".into(),
    ..Default::default()
};

let bridge = bridge::new(bridge_info).unwrap();
let first_bulb = lightbulb::new(first_bulb_info).unwrap();
let second_bulb = lightbulb::new(second_bulb_info).unwrap();

let mut ip_transport = IpTransport::new(config).unwrap();
ip_transport.add_accessory(bridge).unwrap();
ip_transport.add_accessory(first_bulb).unwrap();
ip_transport.add_accessory(second_bulb).unwrap();

//ip_transport.start().unwrap();

Trait Implementations

impl Transport for IpTransport<FileStorage>[src]

Auto Trait Implementations

impl<S> Send for IpTransport<S> where
    S: Send

impl<S> Sync for IpTransport<S> where
    S: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same for T

type Output = T

Should always be Self

impl<T> Erased for T