Accessing struct methods from their dyn trait binding

I'm parsing a tree, and tried using a design where there was a Node trait and a bunch of node types (CharsNode, AndNode, OrNode, ...) which implemented it. These are stored and passed around as Box, which works fine - except I need to get access to some of the specific methods of the structs, and can't because they are not in the trait. For instance, AndNode has a vector nodes: Vec<Box<dyn Node>>. If I get a Node off it and it reports it is an OrNode I cannot find a way to cast it to OrNode so I can access the OrNode methods. Is there some way to do this that I am not seeing?

(I'm making a followup post about one possible way to solve this problem, bu since it is a different question it is split into its own post)

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.