[][src]Struct nom_supreme::final_parser::ByteOffset

pub struct ByteOffset(pub usize);

A byte offset into the input where an error may have occurred

&str Example

use nom_supreme::final_parser::{ByteOffset, RecreateContext};

let original_input = "Hello,\nWorld!\n";
let tail = &original_input[9..];

assert_eq!(
   ByteOffset::recreate_context(original_input, tail),
   ByteOffset(9),
);

# &[u8] Example

use nom_supreme::final_parser::{ByteOffset, RecreateContext};

let original_input = b"GET / HTTP/1.1\r\n";
let tail = &original_input[6..];

assert_eq!(
   ByteOffset::recreate_context(&original_input[..], tail),
   ByteOffset(6),
);

Trait Implementations

impl Clone for ByteOffset[src]

impl Copy for ByteOffset[src]

impl Debug for ByteOffset[src]

impl Eq for ByteOffset[src]

impl PartialEq<ByteOffset> for ByteOffset[src]

impl<I: Offset> RecreateContext<I> for ByteOffset[src]

impl StructuralEq for ByteOffset[src]

impl StructuralPartialEq for ByteOffset[src]

Auto Trait Implementations

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> Conv for T

impl<T> Conv for T

impl<I, T> ExtractContext<I, ()> for T[src]

impl<T> FmtForward for T

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

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

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<I> RecreateContext<I> for I[src]

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T> TryConv for T

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.