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 Tags cannot be turned into invalid JavaScript - regardless of their content.

Required methods

Loading content...

Implementors

impl<D: Display> ToJsString for D[src]

fn to_js_string(&self) -> Result<String>[src]

Turn any Tag into the JavaScript representation of a string.

Loading content...