Open zavakid opened 1 year ago
please use special lifetime 'async_trait
, instead of 'r
in declaration your trait FromText
to mark out the input text is always outlive in whole parse async blocks.
here is the compilable code
@jackalchenxu here I use 'r
in the FromText
because I want to impl for some reference, e.g. I can impl FromText
for &str
like below:
impl <'r> FromText<'r> for &str {
type Output = &'r str;
async fn parse(text: &'r Text) -> Self::Output {
// get string ref from text
}
}
but how can I do above if I change the trait declaration?
hi, here is the code, and will compile for
(A,)
, but can't compile for(A, B)
.here is the code in the playgoround
the error message: