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
Currently, the entire size of the Message needs to be given during construction, but we may be able to avoid having the size declared using the message generics if we rebuild the message when a new word is added. So the WORD generic argument would default to 0, then a command word is added and the word is rebuilt as Message<2>, then a data word is added, and the word is rebuilt as Message<3> etc.
let message= Message::<3>::new().with_command(CommandWord::new().with_address(Address::Value(12)).with_subaddress(SubAddress::Value(5)).with_word_count(2).build()?).with_data(DataWord::new()).with_data(DataWord::new()).build()?;
The text was updated successfully, but these errors were encountered:
Looks like this will only be possible if we can get WORDS (the generic param to Message) + 1, which isn't easily doable without the generic_const_expr flag, which is currently unstable.
Even with this feature, we would still need a way to return a Message from a constructor function with one of two sizes, which seems difficult to do (cleanly anyway- you might be able to figure out something with enums).
Currently, the entire size of the Message needs to be given during construction, but we may be able to avoid having the size declared using the message generics if we rebuild the message when a new word is added. So the
WORD
generic argument would default to 0, then a command word is added and the word is rebuilt asMessage<2>
, then a data word is added, and the word is rebuilt asMessage<3>
etc.The text was updated successfully, but these errors were encountered: