Skip to main content

SymbolSplitter

Struct SymbolSplitter 

Source
pub struct SymbolSplitter<E, F, M> { /* private fields */ }
Expand description

Splits a stream by symbol.

It’s generic over SymbolIndex, allowing it to work with both TsSymbolMap and PitSymbolMap.

Implementations§

Source§

impl<E, F, M> SymbolSplitter<E, F, M>
where F: Fn(&str, Option<Metadata>) -> Result<E>, M: SymbolIndex,

Source

pub fn new(build_encoder: F, symbol_map: M) -> Self

Creates a new splitter that will split the input stream by symbol, creating a separate sub-encoder for each symbol using build_encoder.

The symbol_map is used to look up the symbol for each record based on the instrument ID (and optionally the timestamp for TsSymbolMap).

Trait Implementations§

Source§

impl<E: Debug, F: Debug, M: Debug> Debug for SymbolSplitter<E, F, M>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<E, F, M> Splitter<E> for SymbolSplitter<E, F, M>
where F: Fn(&str, Option<Metadata>) -> Result<E>, M: SymbolIndex,

Source§

fn sub_encoder<R>( &mut self, metadata: Option<&Metadata>, record: &R, ) -> Result<Option<&mut E>>
where R: Record,

Returns the encoder for the given record, or None if the record should be ignored. Read more
Source§

fn sub_encoders<'a>(&'a mut self) -> impl Iterator<Item = &'a mut E>
where E: 'a,

Returns an iterator over all active sub-encoders.

Auto Trait Implementations§

§

impl<E, F, M> Freeze for SymbolSplitter<E, F, M>
where F: Freeze, M: Freeze,

§

impl<E, F, M> RefUnwindSafe for SymbolSplitter<E, F, M>

§

impl<E, F, M> Send for SymbolSplitter<E, F, M>
where F: Send, M: Send, E: Send,

§

impl<E, F, M> Sync for SymbolSplitter<E, F, M>
where F: Sync, M: Sync, E: Sync,

§

impl<E, F, M> Unpin for SymbolSplitter<E, F, M>
where F: Unpin, M: Unpin, E: Unpin,

§

impl<E, F, M> UnsafeUnpin for SymbolSplitter<E, F, M>
where F: UnsafeUnpin, M: UnsafeUnpin,

§

impl<E, F, M> UnwindSafe for SymbolSplitter<E, F, M>
where F: UnwindSafe, M: UnwindSafe, E: 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.
Source§

impl<T> Ungil for T
where T: Send,