stak_device

Struct FixedBufferDevice

Source
pub struct FixedBufferDevice<'a, const O: usize, const E: usize> { /* private fields */ }
Expand description

A fixed buffer device.

Implementations§

Source§

impl<'a, const O: usize, const E: usize> FixedBufferDevice<'a, O, E>

Source

pub const fn new(input: &'a [u8]) -> Self

Creates a device.

Source

pub fn output(&self) -> &[u8]

Returns a reference to standard output.

Source

pub fn error(&self) -> &[u8]

Returns a reference to standard error.

Trait Implementations§

Source§

impl<'a, const O: usize, const E: usize> Debug for FixedBufferDevice<'a, O, E>

Source§

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

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

impl<const O: usize, const E: usize> Device for FixedBufferDevice<'_, O, E>

Source§

type Error = BufferError

An error.
Source§

fn read(&mut self) -> Result<Option<u8>, Self::Error>

Reads from standard input.
Source§

fn write(&mut self, byte: u8) -> Result<(), Self::Error>

Writes to standard output.
Source§

fn write_error(&mut self, byte: u8) -> Result<(), Self::Error>

Writes to standard error.

Auto Trait Implementations§

§

impl<'a, const O: usize, const E: usize> Freeze for FixedBufferDevice<'a, O, E>

§

impl<'a, const O: usize, const E: usize> RefUnwindSafe for FixedBufferDevice<'a, O, E>

§

impl<'a, const O: usize, const E: usize> Send for FixedBufferDevice<'a, O, E>

§

impl<'a, const O: usize, const E: usize> Sync for FixedBufferDevice<'a, O, E>

§

impl<'a, const O: usize, const E: usize> Unpin for FixedBufferDevice<'a, O, E>

§

impl<'a, const O: usize, const E: usize> UnwindSafe for FixedBufferDevice<'a, O, E>

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.