Storing an Arena<AstNode<'_>>
in a struct
#356
Unanswered
nic-hartley
asked this question in
Q&A
Replies: 1 comment 5 replies
-
This should be a lifetime parameter of your struct (that's usual rust stuff): struct SiteGenerator<'ast> {
arena: Arena<AstNode<'ast>>,
// ...
} |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello! I'm trying to make something to the effect of:
Cannot for the life of me figure out what the
'??
should be, or lifetimes in return types, etc. (I tried adding a lifetime parameter, but predictably that didn't work; after all, the lifetime here isn't a parameter, it's the lifetime of the struct.) One option would be creating the arena externally and storing a&'a Arena<AstNode<'a>>
, but that's... annoying? And I feel like there's a better way.Beta Was this translation helpful? Give feedback.
All reactions