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

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)

Methods

impl StrCtx[src]

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

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

Trait Implementations

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

impl Clone for StrCtx[src]

impl Copy for StrCtx[src]

impl Default for StrCtx[src]

impl Debug for StrCtx[src]

Auto Trait Implementations

impl Send for StrCtx

impl Sync for StrCtx

impl Unpin for StrCtx

impl UnwindSafe for StrCtx

impl RefUnwindSafe for StrCtx

Blanket Implementations

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

impl<T> From<T> for 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.

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

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

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