GoSuB Browser Progress, pt35
I'm currently working on some refactoring in order to get something trivial working (html5 and css3 crate depend on each other, and results in a cyclic dependency).. I'm trying to fix this by creating some generic traits in gosub_shared so both html5 and css3 can reference them without stuff breaking. That almost works, but the whole Traits/Generics are new to me so I'm a bit struggling getting things right.
Having a generic Document trait, means we also need some Node traits, which in turn needs some other traits and the whole things gets filled up pretty fast. The biggest issue I have now is that a node can be an ElementNode (things like < div > < a> etc), which in turn has all kind of data (attributes, classes etc). Since both html5 and css3 crates needs this, I must define in it in a trait, which results in all kind of trouble. I've tried to come up with a smaller example: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=9dd09ea3f069aa9069c81dbf1cebeb70
Either i'm almost there and just need to fix a few small things.... or everything is complete wrong and I need to build this from scratch.. still figuring out which one it is..
About jaytaph
Codemuser extraordinaire
Joined: | March 24, 2023 |
Following: | 2 |
Followers: | 2 |
Posts: | 50 |
Comments: | 3 |
Upvotes: | 4 |
Previous musings
- (1) November 2024
- (1) October 2024
- (1) September 2024
- (1) July 2024
- (2) February 2024
- (3) January 2024
- (3) December 2023
- (4) November 2023
- (5) October 2023
- (10) September 2023
- (8) August 2023
- (1) June 2023
- (1) May 2023
- (4) April 2023
- (5) March 2023