The plugins I write are often to enhance an existing aircraft and work that aircraft's custom datarefs. As such they're not guaranteed to be loaded as my plugin might be loaded first.
I've written a ThirdPartyDataref class here: https://github.com/JDeeth/nb_bn2_tweaks/blob/c8284ad96a6457c783a94372b2f92f680fdf2835/src/dataref_command.rs#L10-L50
enum ThirdPartyDataref {
NotFound(String),
Found(DataRef<u32, ReadWrite>),
}
It starts off as NotFound and holds the name of the dataref it should connect to. When trying to get/set the dataref, a NotFound will first search for the dataref and transform itself into a Found if successful.
Would something like this be worth polishing up and moving upstream into this crate?
(I tried to genericise it beyond <u32, ReadWrite> but ran into inexplicable errors that went beyond my limited Rust skills..!)
The plugins I write are often to enhance an existing aircraft and work that aircraft's custom datarefs. As such they're not guaranteed to be loaded as my plugin might be loaded first.
I've written a
ThirdPartyDatarefclass here: https://github.com/JDeeth/nb_bn2_tweaks/blob/c8284ad96a6457c783a94372b2f92f680fdf2835/src/dataref_command.rs#L10-L50It starts off as
NotFoundand holds the name of the dataref it should connect to. When trying to get/set the dataref, aNotFoundwill first search for the dataref and transform itself into aFoundif successful.Would something like this be worth polishing up and moving upstream into this crate?
(I tried to genericise it beyond
<u32, ReadWrite>but ran into inexplicable errors that went beyond my limited Rust skills..!)