Trait tauri_runtime::tag::ToJsString [−][src]
pub trait ToJsString { fn to_js_string(&self) -> Result<String>; }
Expand description
Private helper to turn Tag
related things into JavaScript, safely.
The main concern is string escaping, so we rely on serde_json
to handle all serialization
of the Tag
as a string. We do this instead of requiring serde::Serialize
on Tag
because it really represents a string, not any serializable data structure.
We don’t want downstream users to implement this trait so that Tag
s cannot be turned into
invalid JavaScript - regardless of their content.
Required methods
fn to_js_string(&self) -> Result<String>