Struct Receiver

Source
pub struct Receiver<Proto: DecoderFactory<Mono>, Pin = NoPin, Mono: InfraMonotonic = u32, Cmd: From<Proto::Cmd> = <Proto as Protocol>::Cmd> { /* private fields */ }
Expand description

Event based Receiver

Implementations§

Source§

impl Receiver<Capture<u32>>

Source§

impl<Proto, Mono, Cmd> Receiver<Proto, NoPin, Mono, Cmd>
where Proto: DecoderFactory<Mono>, Mono: InfraMonotonic, Cmd: From<Proto::Cmd>,

Source

pub fn new(freq: u32) -> Receiver<Proto, NoPin, Mono, Cmd>

Source§

impl<Proto, Input, Mono, Cmd> Receiver<Proto, Input, Mono, Cmd>
where Proto: DecoderFactory<Mono>, Mono: InfraMonotonic, Cmd: From<Proto::Cmd>,

Source

pub fn with_input(freq: u32, input: Input) -> Self

Source

pub fn event_edge( &mut self, dt: Mono::Duration, edge: bool, ) -> Result<Option<Cmd>, DecodingError>

Source§

impl<Proto, Pin, Mono, Cmd> Receiver<Proto, Pin, Mono, Cmd>
where Proto: DecoderFactory<Mono>, Pin: InputPin, Mono: InfraMonotonic, Cmd: From<Proto::Cmd>,

Source

pub fn with_pin(resolution: u32, pin: Pin) -> Self

Create a Receiver with pin as input

Source§

impl<Proto, Pin, const HZ: u32, Cmd> Receiver<Proto, Pin, TimerInstantU32<HZ>, Cmd>
where Proto: DecoderFactory<TimerInstantU32<HZ>>, Pin: InputPin, Cmd: From<Proto::Cmd>,

Source

pub fn with_fugit(pin: Pin) -> Self

Create a Receiver with pin as input

Source§

impl<Proto, Pin, const HZ: u32, Cmd> Receiver<Proto, Pin, TimerInstantU64<HZ>, Cmd>
where Proto: DecoderFactory<TimerInstantU64<HZ>>, Pin: InputPin, Cmd: From<Proto::Cmd>,

Source

pub fn with_fugit64(pin: Pin) -> Self

Create a Receiver with pin as input

Source§

impl<Proto, Mono, Cmd> Receiver<Proto, NoPin, Mono, Cmd>
where Proto: DecoderFactory<Mono>, Mono: InfraMonotonic, Cmd: From<Proto::Cmd>,

Source

pub fn event( &mut self, dt: Mono::Duration, edge: bool, ) -> Result<Option<Cmd>, DecodingError>

Source

pub fn event_instant( &mut self, t: Mono::Instant, edge: bool, ) -> Result<Option<Cmd>, DecodingError>

Source§

impl<Proto, Pin, Mono, Cmd> Receiver<Proto, Pin, Mono, Cmd>
where Proto: DecoderFactory<Mono>, Pin: InputPin, Mono: InfraMonotonic, Cmd: From<Proto::Cmd>,

Source

pub fn event( &mut self, dt: Mono::Duration, ) -> Result<Option<Cmd>, Error<Pin::Error>>

Source

pub fn event_instant( &mut self, t: Mono::Instant, ) -> Result<Option<Cmd>, Error<Pin::Error>>

Source

pub fn pin(&self) -> &Pin

Get a reference to the Pin

Source

pub fn pin_mut(&mut self) -> &mut Pin

Get a mut ref to the Pin

Source

pub fn release(self) -> Pin

Drop the receiver and release the pin

Auto Trait Implementations§

§

impl<Proto, Pin, Mono, Cmd> Freeze for Receiver<Proto, Pin, Mono, Cmd>
where <Proto as DecoderFactory<Mono>>::Decoder: Freeze, Pin: Freeze, <Mono as InfraMonotonic>::Instant: Freeze,

§

impl<Proto, Pin, Mono, Cmd> RefUnwindSafe for Receiver<Proto, Pin, Mono, Cmd>

§

impl<Proto, Pin, Mono, Cmd> Send for Receiver<Proto, Pin, Mono, Cmd>
where <Proto as DecoderFactory<Mono>>::Decoder: Send, Pin: Send, <Mono as InfraMonotonic>::Instant: Send, Cmd: Send,

§

impl<Proto, Pin, Mono, Cmd> Sync for Receiver<Proto, Pin, Mono, Cmd>
where <Proto as DecoderFactory<Mono>>::Decoder: Sync, Pin: Sync, <Mono as InfraMonotonic>::Instant: Sync, Cmd: Sync,

§

impl<Proto, Pin, Mono, Cmd> Unpin for Receiver<Proto, Pin, Mono, Cmd>
where <Proto as DecoderFactory<Mono>>::Decoder: Unpin, Pin: Unpin, <Mono as InfraMonotonic>::Instant: Unpin, Cmd: Unpin,

§

impl<Proto, Pin, Mono, Cmd> UnwindSafe for Receiver<Proto, Pin, Mono, Cmd>
where <Proto as DecoderFactory<Mono>>::Decoder: UnwindSafe, Pin: UnwindSafe, <Mono as InfraMonotonic>::Instant: UnwindSafe, Cmd: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.