Enum scroll::ctx::StrCtx[][src]

pub enum StrCtx {
    Delimiter(u8),
    DelimiterUntil(u8usize),
    Length(usize),
}

The parsing context for converting a byte sequence to a &str

StrCtx specifies what byte delimiter to use, and defaults to C-style null terminators. Be careful.

Variants

Delimiter(u8)
DelimiterUntil(u8usize)
Length(usize)

Implementations

impl StrCtx[src]

pub fn len(&self) -> usize[src]

pub fn is_empty(&self) -> bool[src]

Trait Implementations

impl Clone for StrCtx[src]

impl Copy for StrCtx[src]

impl Debug for StrCtx[src]

impl Default for StrCtx[src]

impl<'a> TryFromCtx<'a, StrCtx, [u8]> for &'a str[src]

type Error = Error

fn try_from_ctx(
    src: &'a [u8],
    ctx: StrCtx
) -> Result<(Self, usize), Self::Error>
[src]

Read a &str from src using delimiter

impl<'a, T> TryFromCtx<'a, StrCtx, T> for &'a str where
    T: AsRef<[u8]>, 
[src]

type Error = Error

Auto Trait Implementations

impl RefUnwindSafe for StrCtx

impl Send for StrCtx

impl Sync for StrCtx

impl Unpin for StrCtx

impl UnwindSafe for StrCtx

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.