index_ring_t

Struct index_ring_t 

Source
pub struct index_ring_t<T> { /* private fields */ }

Implementations§

Source§

impl<T> index_ring_t<T>

Source

pub fn new(ring_capacity: usize, start_seq: u64) -> Self

Source

pub fn add_item(&mut self, seq: u64, item: T) -> RESULT

Source

pub fn remove_item(&mut self, seq: u64) -> RESULT

Source

pub fn remove_item_before_seq(&mut self, seq: u64, force: bool) -> RESULT

Source

pub fn get_index_by_seq(&self, seq: u64) -> usize

Source

pub fn get_item_by_seq(&mut self, seq: u64) -> Option<&mut T>

Source

pub fn get_head_item(&mut self) -> Option<&mut T>

Source

pub fn get_head_index(&self) -> usize

Source

pub fn get_tail_index(&self) -> usize

Source

pub fn get_head_seq(&self) -> u64

Source

pub fn get_tail_seq(&self) -> u64

Source

pub fn get_ring_len(&self) -> usize

Source

pub fn get_ring_capacity(&self) -> usize

Source

pub fn get_head_item_state(&self) -> EItemState

Source

pub fn get_item_state(&self, seq: u64) -> EItemState

Source

pub fn get_recv_item_stats(&self) -> (u64, u64)

返回收到的报文以及期望收到的报文数量,计算丢包率

Source

pub fn clear_recv_stats(&mut self)

Source

pub fn get_loss_count(&self) -> u64

Source

pub fn get_loss_rate(&self) -> f32

Source

pub fn clear(&mut self)

Source

pub fn to_string(&self) -> String

Auto Trait Implementations§

§

impl<T> Freeze for index_ring_t<T>

§

impl<T> RefUnwindSafe for index_ring_t<T>
where T: RefUnwindSafe,

§

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

§

impl<T> Sync for index_ring_t<T>
where T: Sync,

§

impl<T> Unpin for index_ring_t<T>
where T: Unpin,

§

impl<T> UnwindSafe for index_ring_t<T>
where 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> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V