Tag

Trait 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 str

Source§

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]

Source§

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]

Source§

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 char

Source§

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 u8

Source§

type Output = u8

Source§

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

Implementors§