Trait pipe_chain::Tag

source ·
pub trait Tag<T, E> {
    type Output;

    // Required method
    fn strip_from(&self, input: T) -> Result<(T, (Self::Output,)), E>;
}
Expand description

Helper trait to recognize a tag

Required Associated Types§

source

type Output

Extracted tag

Required Methods§

source

fn strip_from(&self, input: T) -> Result<(T, (Self::Output,)), E>

remove self from the begining of input

Implementations on Foreign Types§

source§

impl<'a, 'b, E> Tag<&'a str, E> for &'b strwhere E: StdError, Incomplete: Into<E>, TagStrError: Into<E>,

§

type Output = &'a str

source§

fn strip_from(&self, input: &'a str) -> Result<(&'a str, (Self::Output,)), E>

source§

impl<'a, 'b, E> Tag<&'a [u8], E> for &'b [u8]where E: StdError, TagBytesError: Into<E>, Incomplete: Into<E>,

§

type Output = &'a [u8]

source§

fn strip_from(&self, input: &'a [u8]) -> Result<(&'a [u8], (Self::Output,)), E>

source§

impl<'a, 'b, E, const N: usize> Tag<&'a [u8], E> for &'b [u8; N]where E: StdError, Incomplete: Into<E>, TagBytesError: Into<E>,

§

type Output = &'a [u8]

source§

fn strip_from(&self, input: &'a [u8]) -> Result<(&'a [u8], (Self::Output,)), E>

source§

impl<'a, E> Tag<&'a str, E> for charwhere E: StdError, Incomplete: Into<E>, TagCharError: Into<E>,

§

type Output = char

source§

fn strip_from(&self, input: &'a str) -> Result<(&'a str, (Self::Output,)), E>

source§

impl<'a, E> Tag<&'a [u8], E> for u8where E: StdError, Incomplete: Into<E>, TagByteError: Into<E>,

§

type Output = u8

source§

fn strip_from(&self, input: &'a [u8]) -> Result<(&'a [u8], (Self::Output,)), E>

Implementors§