How can I implement as custom struct as input for nom v8.0.0 many0 combinator?

I am facing an issue when using nom, and nom_locate, I am trying to use the many0 from nom, but the input type that it takes in &[u8] where as I had created a custom struct for tokens and spans for nom_locate, and this is my code for the token struct

#[derive(Debug, Clone, PartialEq)]
pub struct Token<'a> {
    pub token_type: TokenType<'a>,
    pub span: Span<'a>,
}
pub type Span<'a> = LocatedSpan<&'a str>;
#[derive(Debug, Clone, PartialEq)]
pub enum TokenType<'a> {
    // Keywords
    KeywordClass,
    KeywordImplements,
    KeywordNamespace,
    KeywordThis,
    KeywordCtx,
    Identifier(&'a str),
}

How can I implement Input trait from nom for this issue? Or should I be even trying this? Is there an alternative??

fn parse_relation_block<'a>(input: &'a [Token<'a>]) -> ParseResult<'a, Vec<Relation<'a>>> {
    // Expect "related: {"
    let (input, _) = expect_token_with_value(TokenType::Identifier("related")).parse(input)?;
    let (input, _) = expect_token(TokenType::OperatorColon).parse(input)?;
    let (input, _) = expect_token(TokenType::BraceLeft).parse(input)?;

    // Parse relation entries
    let (input, relations_opt) = many0(alt((
        map(parse_relation_entry, Some),
        map(expect_token(TokenType::Semicolon), |_| None),
    )))
    .parse(input)?;
    let (input, _) = expect_token(TokenType::BraceRight).parse(input)?;
    //
    // // Filter out None values (from semicolons)
    let relations = relations_opt.into_iter().flatten().collect();
    //
    Ok((input, relations))
}

That's not what the docs say:

pub fn many0<I, F>(
    f: F,
) -> impl Parser<I, Output = Vec<<F as Parser<I>>::Output>, Error = <F as Parser<I>>::Error>
where
    I: Clone + Input,
    F: Parser<I>,

(where Parser is a bunch of methods like:

    fn parse(
        &mut self,
        input: Input,
    ) -> IResult<Input, Self::Output, Self::Error> { ... }

)

To implement an input, you implement Input


The simplest alternative is to implement tokenization in nom too. The main trick there is you need to be careful to not do the simple parser alt((tag("true"), tag("false"), id())) directly on raw input, as that will match true in true_value, but instead to do something like verify(token(), |t| matches!(t, True | False | Id(_))) (there's other options too, that's just the most straightforward)