use nom::bytes::complete::tag; fn main() { let input = "this is my test input".to_owned(); let wrapped_input = WrappedInput::new(input.as_str()); let output = tag::<_, _, (_, nom::error::ErrorKind)>("this")(wrapped_input).unwrap(); println!("{:#?}", output); } #[derive(Debug)] struct WrappedInput<'s> { contents: &'s str, } impl<'s> WrappedInput<'s> { pub fn new(input: &'s str) -> Self { WrappedInput { contents: input } } }