You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to try this one! Just to make sure I understand, after this change, the code that builds the application should be something like this?
letmut application =
PtCloudsApplication::new(&copper_ctx).expect("Failed to create application.");
Also, I'm not sure if the idea is to replace the current "new" method, which would break code from this version that use it, or to keep the current "new" method and create another method that takes CopperContext.
I was going to suggest the From trait, so the application could be built with App::From(&context) or context.into(), but I'm not sure it's the optimal solution, because if sim_mode is set to true, the "new" method needs a callback parameter that is not available in the CopperContext.
maybe adding another new_from_context or something like that would be a little bit more flexible & idiomatic. That said we could always add parameters to the context.
Another proposal would be to use a builder pattern like : Application::new().with_context(...).sim_mode(...)... .build() // would be very nice no?
also I think we would need to move context in the cu29_runtime crate to make that cleaner.
Let's get a first draft going and we can jam on it.
Today we have a helper
basic_copper_setup
that sets up all the runtime for copper:But the generated application from the ron file gets separately the clock and the logger from that context.
Maybe we could officialise this CopperContext and just have the generated application from cu29_derive get a context?
The text was updated successfully, but these errors were encountered: