Struct contec_protocol::PulseOximeter
source · [−]pub struct PulseOximeter<T: AsyncReadWrite + Unpin> { /* private fields */ }
Expand description
Represents a connection with a pulse oximeter.
Use the PulseOximeter::send_package() and PulseOximeter::receive_package methods to communicate with the foobar device.
Implementations
sourceimpl<T: AsyncReadWrite + Unpin> PulseOximeter<T>
impl<T: AsyncReadWrite + Unpin> PulseOximeter<T>
sourcepub fn new(port: T) -> Self
pub fn new(port: T) -> Self
Create a pulse oximeter interface, using the given port
for communication.
sourcepub fn send_package<P>(
&mut self,
package: P
) -> impl Future<Output = Result<(), T::Error>> + '_ where
P: OutgoingPackage,
pub fn send_package<P>(
&mut self,
package: P
) -> impl Future<Output = Result<(), T::Error>> + '_ where
P: OutgoingPackage,
Send a package to the device.
Note that if a future returned by a previous call to this function was not polled until completion, the rest of the package of the previous call will be sent before the new package will be sent.
sourcepub fn receive_package(
&mut self
) -> impl Future<Output = Result<IncomingPackage, T::Error>> + '_
pub fn receive_package(
&mut self
) -> impl Future<Output = Result<IncomingPackage, T::Error>> + '_
Receive the next package from the device.
Auto Trait Implementations
impl<T> RefUnwindSafe for PulseOximeter<T> where
T: RefUnwindSafe,
impl<T> Send for PulseOximeter<T> where
T: Send,
impl<T> Sync for PulseOximeter<T> where
T: Sync,
impl<T> Unpin for PulseOximeter<T>
impl<T> UnwindSafe for PulseOximeter<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more