SeekAdapter

Struct SeekAdapter 

Source
pub struct SeekAdapter<R: Clone + Read<Error: Copy> + Seek> { /* private fields */ }
Expand description

An adapter from embedded_io::Seek to core_json::BytesLike.

This will Clone the underlying reader less frequently than ReadAdapter due to being able to use Seek to implement peek.

Trait Implementations§

Source§

impl<R: Clone + Read<Error: Copy> + Seek> BytesLike<'static> for SeekAdapter<R>

Source§

type Error = Error<R>

The type for errors when interacting with these bytes.
Source§

type ExternallyTrackedLength = usize

The type representing the length of a read BytesLike, if a BytesLike does not inherently know its length. Read more
Source§

fn len(&self, len: Self::ExternallyTrackedLength) -> usize

The length of these bytes.
Source§

fn peek(&self, i: usize) -> Result<u8, Self::Error>

Peak at a byte.
Source§

fn read_bytes( &mut self, bytes: usize, ) -> Result<(Self::ExternallyTrackedLength, Self), Self::Error>

Read a fixed amount of bytes from the container. Read more
Source§

fn read_into_slice(&mut self, slice: &mut [u8]) -> Result<(), Self::Error>

Read a fixed amount of bytes from the container into a slice.
Source§

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

Read a byte from the container.
Source§

fn advance(&mut self, bytes: usize) -> Result<(), Self::Error>

Advance the container by a certain amount of bytes.
Source§

impl<R: Clone + Read<Error: Copy> + Seek> Debug for SeekAdapter<R>

Source§

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

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

impl<R: Clone + Read<Error: Copy> + Seek> From<R> for SeekAdapter<R>

Source§

fn from(reader: R) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<R> !Freeze for SeekAdapter<R>

§

impl<R> !RefUnwindSafe for SeekAdapter<R>

§

impl<R> Send for SeekAdapter<R>
where <R as ErrorType>::Error: Sized, R: Send,

§

impl<R> !Sync for SeekAdapter<R>

§

impl<R> Unpin for SeekAdapter<R>
where <R as ErrorType>::Error: Sized, R: Unpin,

§

impl<R> UnwindSafe for SeekAdapter<R>
where <R as ErrorType>::Error: Sized, R: 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, 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.