Struct Cursor

Source
pub struct Cursor<S> { /* private fields */ }
Expand description

A stateful wrapper to make a Str a readable Source

Implementations§

Source§

impl<'de, S: Str<'de>> Cursor<S>

Source

pub fn new(source: S) -> Self

Creates a Cursor that reads the whole Str

Trait Implementations§

Source§

impl<'de, S: Str<'de>> Source<'de, S> for Cursor<S>

Source§

fn offset(&self) -> usize

Returns the number of bytes already read from the source.
Source§

fn limit(&self) -> usize

Returns the maximum possible number of bytes in the source. Read more
Source§

fn read_u8_char(&mut self) -> IoResult<u8>

Reads one byte from the source. Read more
Source§

fn read_str(&mut self, n: usize) -> IoResult<S>

Reads n bytes from the source. Read more
Source§

unsafe fn read_until(&mut self, byte: u8) -> IoResult<S>

Reads the source until the byte byte. Read more

Auto Trait Implementations§

§

impl<S> Freeze for Cursor<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for Cursor<S>
where S: RefUnwindSafe,

§

impl<S> Send for Cursor<S>
where S: Send,

§

impl<S> Sync for Cursor<S>
where S: Sync,

§

impl<S> Unpin for Cursor<S>
where S: Unpin,

§

impl<S> UnwindSafe for Cursor<S>
where S: 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.