Skip to main content

RbRef

Trait RbRef 

Source
pub unsafe trait RbRef: Clone + AsRef<Self::Rb> {
    type Rb: RingBuffer + ?Sized;

    // Provided method
    fn rb(&self) -> &Self::Rb { ... }
}
Expand description

Abstract pointer to the owning ring buffer.

§Safety

Implementation must be fair (e.g. not replacing pointers between calls and so on).

Required Associated Types§

Source

type Rb: RingBuffer + ?Sized

Underlying ring buffer.

Provided Methods§

Source

fn rb(&self) -> &Self::Rb

Get ring buffer reference.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<B: RingBuffer + ?Sized> RbRef for Rc<B>

Available on crate feature alloc only.
Source§

type Rb = B

Source§

impl<B: RingBuffer + AsRef<B> + ?Sized> RbRef for &B

Source§

type Rb = B

Implementors§

Source§

impl<B: RingBuffer + ?Sized> RbRef for Arc<B>

Available on crate feature alloc only.
Source§

type Rb = B