Skip to main content

ReaderHandle

Struct ReaderHandle 

Source
pub struct ReaderHandle<E: Encoding = FlatBuffers> { /* private fields */ }
Expand description

The &self port roles: Attached, Clock, SignalReader, FixedReader, and the two signal extensions.

It is Send + Sync, so several threads may hold one and read at once, and a face that needs only SignalReader can be built over this handle directly rather than over the aggregate: like every handle, it carries the runtime’s encoding E, which such a face reads from it.

Trait Implementations§

Source§

impl<E: Encoding> Attached for ReaderHandle<E>

Source§

fn catalog(&self) -> &CatalogRef

The catalog this port serves.
Source§

impl<E: Encoding> Clock for ReaderHandle<E>

Source§

fn now(&self) -> Timestamp

The current time in the platform time base.
Source§

impl<E: Encoding> CoherentSignals for ReaderHandle<E>

Source§

fn read_coherent( &self, iface: InterfaceNo, ords: &[Ordinal], out: &mut [u8], samples: &mut [RawSample], ) -> Result<usize, ReadError>

Answers every ordinal in ords from one publication. Copies the values into out one after another, writes one RawSample for each ordinal into samples in the order of ords, and returns the number of bytes written to out. Read more
Source§

impl<E: Encoding> Encoded for ReaderHandle<E>

Source§

type Encoding = E

The encoding of the bytes this port carries.
Source§

impl<E: Encoding> FixedReader for ReaderHandle<E>

Source§

fn read_fixed( &self, iface: InterfaceNo, ord: Ordinal, out: &mut [u8], ) -> Result<usize, ReadError>

Copies the provisioned value into the front of out and returns its length.
Source§

impl<E: Encoding> ScannableSignals for ReaderHandle<E>

Source§

fn generation(&self, iface: InterfaceNo) -> u64

The interface’s generation: a counter that each commit to the interface increments. Read more
Source§

fn scan(&self, marks: &mut [Watermark], out: &mut [Changed]) -> usize

Writes the changes into out, interface by interface, in the order of marks, and updates marks. An interface’s changes are written all together or not at all: when they do not fit in the rest of out, none of them is written, that interface’s mark is not updated, and scan returns the number of entries written so far. Read more
Source§

impl<E: Encoding> SignalReader for ReaderHandle<E>

Source§

fn read( &self, iface: InterfaceNo, ord: Ordinal, out: &mut [u8], ) -> Result<RawSample, ReadError>

Copies the signal’s current value into the front of out and returns its provenance, its freshness and its envelope. The runtime resolves both the provenance and the freshness. Read more
Source§

impl<E: Encoding> Wakeable for ReaderHandle<E>

Source§

fn wake_on(&self, _: Interest, waker: &Waker)

Wakes waker when the thing what names may have changed, under the contract above.

Auto Trait Implementations§

§

impl<E> Freeze for ReaderHandle<E>
where PhantomData<E>: Freeze,

§

impl<E> RefUnwindSafe for ReaderHandle<E>

§

impl<E> Send for ReaderHandle<E>
where PhantomData<E>: Send,

§

impl<E> Sync for ReaderHandle<E>
where PhantomData<E>: Sync,

§

impl<E> Unpin for ReaderHandle<E>
where PhantomData<E>: Unpin,

§

impl<E> UnsafeUnpin for ReaderHandle<E>

§

impl<E> UnwindSafe for ReaderHandle<E>

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.