GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Docs.rs
  • ringfire-0.5.2
  • Permalink
  • Docs.rs crate page
  • MIT
  • Apache-2.0
  • Repository
  • crates.io
  • Source
  • alex09x
  • futures-core ^0.3 normal optional
  • libc ^0.2 normal
  • memmap2 ^0.9 normal
  • tokio ^1 normal optional

This view

  • Original page
  • New address

GeezerVison is showing docs.rs — RingMultiplexer in ringfire::multiplexer - Rust

ringfire::multiplexer

Struct RingMultiplexer 

Source
pub struct RingMultiplexer<T: Copy + LayoutSignature + 'static> { /* private fields */ }
Expand description

Synchronous channel multiplexer across multiple RingConsumer<T> instances.

Implementations§

Source§

impl<T: Copy + LayoutSignature + 'static> RingMultiplexer<T>

Source

pub fn new() -> Self

Creates a new empty RingMultiplexer.

Source

pub fn add(&mut self, consumer: RingConsumer<T>) -> usize

Adds an existing RingConsumer to the multiplexer. Returns its channel index.

Source

pub fn add_named<S: Into<String>>( &mut self, name: S, consumer: RingConsumer<T>, ) -> usize

Adds an existing RingConsumer with a human-readable channel name.

Source

pub fn attach<P: AsRef<Path>>(&mut self, path: P) -> Result<usize>

Attaches to a ring buffer at path and adds it to the multiplexer.

Source

pub fn attach_named<P: AsRef<Path>, S: Into<String>>( &mut self, name: S, path: P, ) -> Result<usize>

Attaches to a ring buffer at path with a custom channel name.

Source

pub fn len(&self) -> usize

Total number of multiplexed ring buffer channels.

Source

pub fn is_empty(&self) -> bool

Returns true if no channels have been added yet.

Source

pub fn channel_name(&self, idx: usize) -> Option<&str>

Name of the channel at index idx.

Source

pub fn consumer(&self, idx: usize) -> Option<&RingConsumer<T>>

Reference to the underlying consumer at index idx.

Source

pub fn consumer_mut(&mut self, idx: usize) -> Option<&mut RingConsumer<T>>

Mutable reference to the underlying consumer at index idx.

Source

pub fn try_recv_any(&mut self) -> Option<(usize, T)>

Polls all channels using fair Round-Robin scheduling.

Returns Some((channel_index, message)) from the next available channel, or None if all channels are currently empty.

Source

pub fn try_recv_priority(&mut self) -> Option<(usize, T)>

Polls channels strictly in priority order (0, 1, 2, …, N-1).

Favors higher-priority channels (e.g. primary liquidity, risk cancels).

Source

pub fn recv_batch_any(&mut self, max_items: usize) -> Vec<(usize, T)>

Drains up to max_items across all channels in a single batch.

Trait Implementations§

Source§

impl<T: Copy + LayoutSignature + 'static> Default for RingMultiplexer<T>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<T> !Sync for RingMultiplexer<T>

§

impl<T> Forget for RingMultiplexer<T>

§

impl<T> Freeze for RingMultiplexer<T>
where Vec<RingConsumer<T>>: Freeze,

§

impl<T> Move for RingMultiplexer<T>

§

impl<T> RefUnwindSafe for RingMultiplexer<T>
where Vec<RingConsumer<T>>: RefUnwindSafe,

§

impl<T> Send for RingMultiplexer<T>
where Vec<RingConsumer<T>>: Send,

§

impl<T> Unpin for RingMultiplexer<T>
where Vec<RingConsumer<T>>: Unpin,

§

impl<T> UnsafeUnpin for RingMultiplexer<T>
where Vec<RingConsumer<T>>: UnsafeUnpin,

§

impl<T> UnwindSafe for RingMultiplexer<T>
where Vec<RingConsumer<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<T> LayoutSignature for T
where T: 'static,

Source§

fn layout_signature() -> u64

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.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.