device-envoy-esp 0.1.0

Build ESP32 applications with composable device abstractions
Documentation
// @generated by `cargo check-all`. Do not edit by hand.
//! Module containing sample struct types generated by IR macros:
//! [`IrGenerated`], [`IrMappingGenerated`], and [`IrKeplerGenerated`].
//!
//! Auto-generated.

#[cfg(doc)]
use crate::Result;
#[cfg(doc)]
use crate::ir::{Ir, IrEvent, IrKepler, IrMapping, KeplerKeys};

#[cfg(doc)]
/// Sample struct type generated by the [`ir!`](macro@crate::ir) macro.
///
/// This page exists to show constructor and trait methods in one place. For
/// narrative examples, see the [`ir`](mod@crate::ir) module.
///
/// Auto-generated.
pub struct IrGenerated;

#[cfg(doc)]
impl IrGenerated {
    /// Create a new IR receiver instance of the struct type defined by
    /// [`ir!`](macro@crate::ir).
    ///
    /// See the [`ir`](mod@crate::ir) module docs for usage examples.
    pub fn new(
        pin: impl Sized,
        channel_creator: impl Sized,
        spawner: embassy_executor::Spawner,
    ) -> Result<&'static Self> {
        static INSTANCE: IrGenerated = IrGenerated;
        let _ = (pin, channel_creator, spawner);
        Ok(&INSTANCE)
    }
}

#[cfg(doc)]
impl Ir for IrGenerated {
    async fn wait_for_press(&self) -> IrEvent {
        core::future::pending().await
    }
}

#[cfg(doc)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
/// Sample key enum used by [`IrMappingGenerated`].
pub enum RemoteKeysGenerated {
    /// Power key.
    Power,
    /// Play key.
    Play,
    /// Stop key.
    Stop,
}

#[cfg(doc)]
/// Sample struct type generated by the [`ir_mapping!`](macro@crate::ir_mapping) macro.
///
/// This page exists to show constructor and trait methods in one place. For
/// narrative examples, see the [`ir`](mod@crate::ir) module.
///
/// Auto-generated.
pub struct IrMappingGenerated;

#[cfg(doc)]
impl IrMappingGenerated {
    /// Create a new IR mapping instance of the struct type defined by
    /// [`ir_mapping!`](macro@crate::ir_mapping).
    ///
    /// See the [`ir`](mod@crate::ir) module docs for usage examples.
    pub fn new(
        pin: impl Sized,
        channel_creator: impl Sized,
        button_map: &[(u16, u8, RemoteKeysGenerated)],
        spawner: embassy_executor::Spawner,
    ) -> Result<&'static Self> {
        static INSTANCE: IrMappingGenerated = IrMappingGenerated;
        let _ = (pin, channel_creator, button_map, spawner);
        Ok(&INSTANCE)
    }
}

#[cfg(doc)]
impl IrMapping<RemoteKeysGenerated> for IrMappingGenerated {
    async fn wait_for_press(&self) -> RemoteKeysGenerated {
        core::future::pending().await
    }
}

#[cfg(doc)]
/// Sample struct type generated by the [`ir_kepler!`](macro@crate::ir_kepler) macro.
///
/// This page exists to show constructor and trait methods in one place. For
/// narrative examples, see the [`ir`](mod@crate::ir) module.
///
/// Auto-generated.
pub struct IrKeplerGenerated;

#[cfg(doc)]
impl IrKeplerGenerated {
    /// Create a new Kepler IR instance of the struct type defined by
    /// [`ir_kepler!`](macro@crate::ir_kepler).
    ///
    /// See the [`ir`](mod@crate::ir) module docs for usage examples.
    pub fn new(
        pin: impl Sized,
        channel_creator: impl Sized,
        spawner: embassy_executor::Spawner,
    ) -> Result<&'static Self> {
        static INSTANCE: IrKeplerGenerated = IrKeplerGenerated;
        let _ = (pin, channel_creator, spawner);
        Ok(&INSTANCE)
    }
}

#[cfg(doc)]
impl IrKepler for IrKeplerGenerated {
    async fn wait_for_press(&self) -> KeplerKeys {
        core::future::pending().await
    }
}