swift-bridge
swift-bridge copied to clipboard
Unable to return Option<String>
This is my struct:
pub struct DiscordRPCAgent {
client: DiscordIpcClient,
state: Option<String>,
details: Option<String>,
start_timestamp: Option<i64>,
end_timestamp: Option<i64>,
large_image: Option<&'static str>,
large_text: Option<&'static str>,
small_image: Option<&'static str>,
small_text: Option<&'static str>,
}
I would like to have properties that state
and details
as Option<String>
#[swift_bridge(get(&state))]
fn state(&self) -> Option<String>;
#[swift_bridge(get(&details))]
fn details(&self) -> Option<String>;
But then the compiler throws an error:
Removing the &
does not help
Hey.
I don't see Option
in your error message at all. That's peculiar.
It makes me uncertain about whether or not your error message came from that example?
At any rate.
Can you please provide a minimal bridge module and minimal struct that illustrate your issue, along with the error message that you see for that minimal bridge module and struct?
This will make it easier to understand the exact problem that you're facing.
Thanks!