This struct:
#[derive(uniffi::Record)]
pub struct BoltzSessionBuilder {
...
#[uniffi(default = None)]
mnemonic: Option<Arc<Mnemonic>>,
#[uniffi(default = None)]
logging: Option<Arc<dyn Logging>>,
...
}
Gets converted to this:
struct BoltzSessionBuilder {
...
std::shared_ptr<Mnemonic> mnemonic = std::nullopt;
std::shared_ptr<Logging> logging = std::nullopt;
...
};
The Option<Arc<Mnemonic> is flattened to std::shared_ptr<Mnemonic> as shared pointer can be without pointing to object so it has a behavior as optional, but the default values are kept as it is std::optional<>. Same for logging!
Question here is, is this a bug or there is correct approach to avoid this?
This struct:
Gets converted to this:
The
Option<Arc<Mnemonic>is flattened tostd::shared_ptr<Mnemonic>as shared pointer can be without pointing to object so it has a behavior as optional, but the default values are kept as it isstd::optional<>. Same for logging!Question here is, is this a bug or there is correct approach to avoid this?