Struct CircBuffer

Source
pub struct CircBuffer<BUFFER, PAYLOAD>
where BUFFER: 'static,
{ /* private fields */ }

Implementations§

Source§

impl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C1>>
where RxDma<PAYLOAD, C1>: TransferPayload,

Source

pub fn peek<R, F>(&mut self, f: F) -> Result<R, Error>
where F: FnOnce(&B, Half) -> R,

Peeks into the readable half of the buffer

Source

pub fn readable_half(&mut self) -> Result<Half, Error>

Returns the Half of the buffer that can be read

Source

pub fn stop(self) -> (&'static mut [B; 2], RxDma<PAYLOAD, C1>)

Stops the transfer and returns the underlying buffer and RxDma

Source§

impl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C2>>
where RxDma<PAYLOAD, C2>: TransferPayload,

Source

pub fn peek<R, F>(&mut self, f: F) -> Result<R, Error>
where F: FnOnce(&B, Half) -> R,

Peeks into the readable half of the buffer

Source

pub fn readable_half(&mut self) -> Result<Half, Error>

Returns the Half of the buffer that can be read

Source

pub fn stop(self) -> (&'static mut [B; 2], RxDma<PAYLOAD, C2>)

Stops the transfer and returns the underlying buffer and RxDma

Source§

impl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C3>>
where RxDma<PAYLOAD, C3>: TransferPayload,

Source

pub fn peek<R, F>(&mut self, f: F) -> Result<R, Error>
where F: FnOnce(&B, Half) -> R,

Peeks into the readable half of the buffer

Source

pub fn readable_half(&mut self) -> Result<Half, Error>

Returns the Half of the buffer that can be read

Source

pub fn stop(self) -> (&'static mut [B; 2], RxDma<PAYLOAD, C3>)

Stops the transfer and returns the underlying buffer and RxDma

Source§

impl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C4>>
where RxDma<PAYLOAD, C4>: TransferPayload,

Source

pub fn peek<R, F>(&mut self, f: F) -> Result<R, Error>
where F: FnOnce(&B, Half) -> R,

Peeks into the readable half of the buffer

Source

pub fn readable_half(&mut self) -> Result<Half, Error>

Returns the Half of the buffer that can be read

Source

pub fn stop(self) -> (&'static mut [B; 2], RxDma<PAYLOAD, C4>)

Stops the transfer and returns the underlying buffer and RxDma

Source§

impl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C5>>
where RxDma<PAYLOAD, C5>: TransferPayload,

Source

pub fn peek<R, F>(&mut self, f: F) -> Result<R, Error>
where F: FnOnce(&B, Half) -> R,

Peeks into the readable half of the buffer

Source

pub fn readable_half(&mut self) -> Result<Half, Error>

Returns the Half of the buffer that can be read

Source

pub fn stop(self) -> (&'static mut [B; 2], RxDma<PAYLOAD, C5>)

Stops the transfer and returns the underlying buffer and RxDma

Source§

impl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C6>>
where RxDma<PAYLOAD, C6>: TransferPayload,

Source

pub fn peek<R, F>(&mut self, f: F) -> Result<R, Error>
where F: FnOnce(&B, Half) -> R,

Peeks into the readable half of the buffer

Source

pub fn readable_half(&mut self) -> Result<Half, Error>

Returns the Half of the buffer that can be read

Source

pub fn stop(self) -> (&'static mut [B; 2], RxDma<PAYLOAD, C6>)

Stops the transfer and returns the underlying buffer and RxDma

Source§

impl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C7>>
where RxDma<PAYLOAD, C7>: TransferPayload,

Source

pub fn peek<R, F>(&mut self, f: F) -> Result<R, Error>
where F: FnOnce(&B, Half) -> R,

Peeks into the readable half of the buffer

Source

pub fn readable_half(&mut self) -> Result<Half, Error>

Returns the Half of the buffer that can be read

Source

pub fn stop(self) -> (&'static mut [B; 2], RxDma<PAYLOAD, C7>)

Stops the transfer and returns the underlying buffer and RxDma

Source§

impl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C1>>
where RxDma<PAYLOAD, C1>: TransferPayload,

Source

pub fn peek<R, F>(&mut self, f: F) -> Result<R, Error>
where F: FnOnce(&B, Half) -> R,

Peeks into the readable half of the buffer

Source

pub fn readable_half(&mut self) -> Result<Half, Error>

Returns the Half of the buffer that can be read

Source

pub fn stop(self) -> (&'static mut [B; 2], RxDma<PAYLOAD, C1>)

Stops the transfer and returns the underlying buffer and RxDma

Source§

impl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C2>>
where RxDma<PAYLOAD, C2>: TransferPayload,

Source

pub fn peek<R, F>(&mut self, f: F) -> Result<R, Error>
where F: FnOnce(&B, Half) -> R,

Peeks into the readable half of the buffer

Source

pub fn readable_half(&mut self) -> Result<Half, Error>

Returns the Half of the buffer that can be read

Source

pub fn stop(self) -> (&'static mut [B; 2], RxDma<PAYLOAD, C2>)

Stops the transfer and returns the underlying buffer and RxDma

Source§

impl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C3>>
where RxDma<PAYLOAD, C3>: TransferPayload,

Source

pub fn peek<R, F>(&mut self, f: F) -> Result<R, Error>
where F: FnOnce(&B, Half) -> R,

Peeks into the readable half of the buffer

Source

pub fn readable_half(&mut self) -> Result<Half, Error>

Returns the Half of the buffer that can be read

Source

pub fn stop(self) -> (&'static mut [B; 2], RxDma<PAYLOAD, C3>)

Stops the transfer and returns the underlying buffer and RxDma

Source§

impl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C4>>
where RxDma<PAYLOAD, C4>: TransferPayload,

Source

pub fn peek<R, F>(&mut self, f: F) -> Result<R, Error>
where F: FnOnce(&B, Half) -> R,

Peeks into the readable half of the buffer

Source

pub fn readable_half(&mut self) -> Result<Half, Error>

Returns the Half of the buffer that can be read

Source

pub fn stop(self) -> (&'static mut [B; 2], RxDma<PAYLOAD, C4>)

Stops the transfer and returns the underlying buffer and RxDma

Source§

impl<B, PAYLOAD> CircBuffer<B, RxDma<PAYLOAD, C5>>
where RxDma<PAYLOAD, C5>: TransferPayload,

Source

pub fn peek<R, F>(&mut self, f: F) -> Result<R, Error>
where F: FnOnce(&B, Half) -> R,

Peeks into the readable half of the buffer

Source

pub fn readable_half(&mut self) -> Result<Half, Error>

Returns the Half of the buffer that can be read

Source

pub fn stop(self) -> (&'static mut [B; 2], RxDma<PAYLOAD, C5>)

Stops the transfer and returns the underlying buffer and RxDma

Auto Trait Implementations§

§

impl<BUFFER, PAYLOAD> Freeze for CircBuffer<BUFFER, PAYLOAD>
where PAYLOAD: Freeze,

§

impl<BUFFER, PAYLOAD> RefUnwindSafe for CircBuffer<BUFFER, PAYLOAD>
where PAYLOAD: RefUnwindSafe, BUFFER: RefUnwindSafe,

§

impl<BUFFER, PAYLOAD> Send for CircBuffer<BUFFER, PAYLOAD>
where PAYLOAD: Send, BUFFER: Send,

§

impl<BUFFER, PAYLOAD> Sync for CircBuffer<BUFFER, PAYLOAD>
where PAYLOAD: Sync, BUFFER: Sync,

§

impl<BUFFER, PAYLOAD> Unpin for CircBuffer<BUFFER, PAYLOAD>
where PAYLOAD: Unpin,

§

impl<BUFFER, PAYLOAD> !UnwindSafe for CircBuffer<BUFFER, PAYLOAD>

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.