[−][src]Struct plm::Modem
A Modem is a connection to an INSTEON Modem. It can be used to send Messages and manage device links (e.g. Modem::link_device).
Implementations
impl Modem
[src]
pub fn from_path(path: impl AsRef<Path> + Send + 'static) -> Result<Self>
[src]
Constructs a new Modem
given a path to a serial port
Arguments
path
- The path to a serial port with an INSTEON modem attached.
pub fn new(
handle: impl AsyncReadExt + AsyncWriteExt + Unpin + Send + 'static
) -> Modem
[src]
handle: impl AsyncReadExt + AsyncWriteExt + Unpin + Send + 'static
) -> Modem
Constructs a new Modem
from an arbitrary I/O modem
Arguments
handle
- An async readable, writable modem
pub async fn send_message<'_>(
&'_ mut self,
message: Message
) -> Result<Message, Error>
[src]
&'_ mut self,
message: Message
) -> Result<Message, Error>
Sends a Message. This uses the default timeout duration defined by DEFAULT_TIMEOUT_DURATION.
Returns an acknowledged Message or an error.
pub async fn send_message_with_timeout<'_>(
&'_ mut self,
message: Message,
duration: Duration
) -> Result<Message, Error>
[src]
&'_ mut self,
message: Message,
duration: Duration
) -> Result<Message, Error>
pub async fn get_info<'_>(&'_ mut self) -> Result<ModemInfo, Error>
[src]
Retrieve information about the attached modem.
pub async fn get_links<'_>(
&'_ mut self
) -> Result<impl Iterator<Item = AllLinkRecord>, Error>
[src]
&'_ mut self
) -> Result<impl Iterator<Item = AllLinkRecord>, Error>
Return the link database stored in the modem.
pub async fn listen<'_>(
&'_ mut self
) -> Result<impl Stream<Item = Message> + Sync + Send + Unpin, Error>
[src]
&'_ mut self
) -> Result<impl Stream<Item = Message> + Sync + Send + Unpin, Error>
pub async fn link_device<'_>(
&'_ mut self,
address: Option<Address>,
mode: AllLinkMode,
group: u8
) -> Result<AllLinkComplete, Error>
[src]
&'_ mut self,
address: Option<Address>,
mode: AllLinkMode,
group: u8
) -> Result<AllLinkComplete, Error>
Link a new device to the modem.
Auto Trait Implementations
impl !RefUnwindSafe for Modem
impl Send for Modem
impl Sync for Modem
impl Unpin for Modem
impl !UnwindSafe for Modem
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> 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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,