Struct Serializer

Source
pub struct Serializer<T, BF> { /* private fields */ }
Expand description

A codelet which serializes a message

Implementations§

Source§

impl<T, BF> Serializer<T, BF>

Source

pub fn new(format: BF) -> Self

Trait Implementations§

Source§

impl<T, BF> Codelet for Serializer<T, BF>
where T: Send + Sync, BF: Send + BinaryFormat<T>,

Source§

type Status = DefaultStatus

Status code used to indicate health of codelet
Source§

type Config = SerializerConfig

Type used for configuration
Source§

type Rx = DoubleBufferRx<Message<T>>

Type holding all receiving (RX) endpoints
Source§

type Tx = DoubleBufferTx<Message<Vec<u8>>>

Type holding all transmitting (TX) endpoints
Source§

type Signals = ()

Type storing the codelet’s signals
Source§

fn build_bundles(cfg: &Self::Config) -> (Self::Rx, Self::Tx)

Constructs channel bundles
Source§

fn step( &mut self, cx: Context<'_, Self>, rx: &mut Self::Rx, tx: &mut Self::Tx, ) -> Outcome

Step is executed periodically after the codelet is started and while it is not paused.
Source§

fn start( &mut self, _cx: Context<'_, Self>, _rx: &mut Self::Rx, _tx: &mut Self::Tx, ) -> Result<Self::Status, Report>

Start is guaranteed to be called first. Start may be called again after stop was called.
Source§

fn stop( &mut self, _cx: Context<'_, Self>, _rx: &mut Self::Rx, _tx: &mut Self::Tx, ) -> Result<Self::Status, Report>

Stop is guaranteed to be called at the end if start was called.
Source§

fn pause(&mut self) -> Result<Self::Status, Report>

Pause may be called to suspend stepping.
Source§

fn resume(&mut self) -> Result<Self::Status, Report>

Resume is called to resume stepping. Note that stop may also be called while the codelet is paused to stop the codelet completely instead of resuming stepping.

Auto Trait Implementations§

§

impl<T, BF> Freeze for Serializer<T, BF>
where BF: Freeze,

§

impl<T, BF> RefUnwindSafe for Serializer<T, BF>

§

impl<T, BF> Send for Serializer<T, BF>
where BF: Send, T: Send,

§

impl<T, BF> Sync for Serializer<T, BF>
where BF: Sync, T: Sync,

§

impl<T, BF> Unpin for Serializer<T, BF>
where BF: Unpin, T: Unpin,

§

impl<T, BF> UnwindSafe for Serializer<T, BF>
where BF: UnwindSafe, T: 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<C> IntoInstance for C
where C: Codelet,

Source§

fn into_instance<S>( self, name: S, config: <C as Codelet>::Config, ) -> CodeletInstance<C>
where S: Into<String>,

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.