[−][src]Struct hap::transport::IpTransport
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]
fn start(&mut self) -> Result<(), Error>
[src]
fn stop(&self) -> Result<(), Error>
[src]
fn add_accessory<A: 'static + AccessoryListMember + Send>(
&mut self,
accessory: A
) -> Result<AccessoryListPtr, Error>
[src]
&mut self,
accessory: A
) -> Result<AccessoryListPtr, Error>
fn remove_accessory(
&mut self,
accessory: &AccessoryListPtr
) -> Result<(), Error>
[src]
&mut self,
accessory: &AccessoryListPtr
) -> Result<(), Error>
Auto Trait Implementations
impl<S> Send for IpTransport<S> where
S: Send,
S: Send,
impl<S> Sync for IpTransport<S> where
S: Sync,
S: Sync,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same for T
type Output = T
Should always be Self