Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–61 unchanged (61 lines)
62 ))
63 }
64 }
65}
66
67#[command(root = "crate")]
68pub fn listen<R: Runtime>(
69 webview: Webview<R>,
70 event: EventName,
71 target: EventTarget,
72 handler: CallbackFn,
73) -> Result<EventId> {
74 webview.listen_js(&event, target, handler)
75}
76
77#[command(root = "crate")]
78pub fn unlisten<R: Runtime>(
79 webview: Webview<R>,
80 event: EventName,
81 event_id: EventId,
82) -> Result<()> {
83 webview.unlisten_js(&event, event_id)
84}
85
86#[command(root = "crate")]
87pub fn emit<R: Runtime>(
88 app: AppHandle<R>,
89 event: EventName,
90 payload: Option<JsonValue>,
91) -> Result<()> {
92 app.emit(&event, payload)
93}
94
95#[command(root = "crate")]
96pub fn emit_to<R: Runtime>(
97 app: AppHandle<R>,
98 target: EventTarget,
99 event: EventName,
100 payload: Option<JsonValue>,
101) -> Result<()> {
102 app.emit_to(target, &event, payload)
…lines 103–111 unchanged (9 lines)

After

…lines 1–61 unchanged (61 lines)
62 ))
63 }
64 }
65}
66
67#[command(root = "crate")]
68pub async fn listen<R: Runtime>(
69 webview: Webview<R>,
70 event: EventName,
71 target: EventTarget,
72 handler: CallbackFn,
73) -> Result<EventId> {
74 webview.listen_js(&event, target, handler)
75}
76
77#[command(root = "crate")]
78pub async fn unlisten<R: Runtime>(
79 webview: Webview<R>,
80 event: EventName,
81 event_id: EventId,
82) -> Result<()> {
83 webview.unlisten_js(&event, event_id)
84}
85
86#[command(root = "crate")]
87pub async fn emit<R: Runtime>(
88 app: AppHandle<R>,
89 event: EventName,
90 payload: Option<JsonValue>,
91) -> Result<()> {
92 app.emit(&event, payload)
93}
94
95#[command(root = "crate")]
96pub async fn emit_to<R: Runtime>(
97 app: AppHandle<R>,
98 target: EventTarget,
99 event: EventName,
100 payload: Option<JsonValue>,
101) -> Result<()> {
102 app.emit_to(target, &event, payload)
…lines 103–111 unchanged (9 lines)

Before

source_file
line_comment
// "//"
line_comment
// "//"
line_comment
// "//"
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "std"
:: "::"
identifier "ops"
:: "::"
identifier "Deref"
; ";"
use_declaration
use "use"
scoped_use_list
identifier "serde"
:: "::"
use_list
{ "{"
identifier "Deserialize"
, ","
identifier "Deserializer"
} "}"
; ";"
use_declaration
use "use"
use_as_clause
scoped_identifier
identifier "serde_json"
:: "::"
identifier "Value"
as "as"
identifier "JsonValue"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "tauri_runtime"
:: "::"
identifier "window"
:: "::"
identifier "is_label_valid"
; ";"
use_declaration
use "use"
scoped_use_list
scoped_identifier
crate "crate"
:: "::"
identifier "plugin"
:: "::"
use_list
{ "{"
identifier "Builder"
, ","
identifier "TauriPlugin"
} "}"
; ";"
use_declaration (+21 nodes collapsed)
use_declaration
use "use"
scoped_use_list
crate "crate"
:: "::"
use_list
{ "{"
identifier "AppHandle"
, ","
identifier "Emitter"
, ","
identifier "Webview"
} "}"
; ";"
use_declaration
use "use"
scoped_use_list
super "super"
:: "::"
use_list
{ "{"
identifier "is_event_name_valid"
, ","
identifier "EventTarget"
} "}"
; ";"
struct_item
visibility_modifier
pub "pub"
struct "struct"
type_identifier "EventName"
ordered_field_declaration_list
( "("
type_identifier "String"
) ")"
; ";"
impl_item (+39 nodes collapsed)
impl_item (+143 nodes collapsed)
struct_item
visibility_modifier
pub "pub"
struct "struct"
type_identifier "WebviewLabel"
ordered_field_declaration_list
( "("
type_identifier "String"
) ")"
; ";"
impl_item (+35 nodes collapsed)
impl_item (+143 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
identifier "command"
token_tree
( "("
identifier "root"
= "="
string_literal
" "\""
string_content "crate"
" "\""
) ")"
] "]"
function_item
visibility_modifier
pub "pub"
fn "fn"
identifier "listen"
type_parameters
< "<"
type_parameter
type_identifier "R"
trait_bounds
: ":"
type_identifier "Runtime"
> ">"
parameters (+28 nodes collapsed)
-> "->"
generic_type
type_identifier "Result"
type_arguments
< "<"
type_identifier "EventId"
> ">"
block
{ "{"
call_expression
field_expression
identifier "webview"
. "."
field_identifier "listen_js"
arguments
( "("
reference_expression
& "&"
identifier "event"
, ","
identifier "target"
, ","
identifier "handler"
) ")"
} "}"
attribute_item
# "#"
[ "["
attribute
identifier "command"
token_tree
( "("
identifier "root"
= "="
string_literal
" "\""
string_content "crate"
" "\""
) ")"
] "]"
function_item
visibility_modifier
pub "pub"
fn "fn"
identifier "unlisten"
type_parameters
< "<"
type_parameter
type_identifier "R"
trait_bounds
: ":"
type_identifier "Runtime"
> ">"
parameters (+23 nodes collapsed)
-> "->"
generic_type
type_identifier "Result"
type_arguments
< "<"
unit_type
( "("
) ")"
> ">"
block
{ "{"
call_expression
field_expression
identifier "webview"
. "."
field_identifier "unlisten_js"
arguments
( "("
reference_expression
& "&"
identifier "event"
, ","
identifier "event_id"
) ")"
} "}"
attribute_item
# "#"
[ "["
attribute
identifier "command"
token_tree
( "("
identifier "root"
= "="
string_literal
" "\""
string_content "crate"
" "\""
) ")"
] "]"
function_item
visibility_modifier
pub "pub"
fn "fn"
identifier "emit"
type_parameters
< "<"
type_parameter
type_identifier "R"
trait_bounds
: ":"
type_identifier "Runtime"
> ">"
parameters (+28 nodes collapsed)
-> "->"
generic_type
type_identifier "Result"
type_arguments
< "<"
unit_type
( "("
) ")"
> ">"
block
{ "{"
call_expression
field_expression
identifier "app"
. "."
field_identifier "emit"
arguments
( "("
reference_expression
& "&"
identifier "event"
, ","
identifier "payload"
) ")"
} "}"
attribute_item
# "#"
[ "["
attribute
identifier "command"
token_tree
( "("
identifier "root"
= "="
string_literal
" "\""
string_content "crate"
" "\""
) ")"
] "]"
function_item
visibility_modifier
pub "pub"
fn "fn"
identifier "emit_to"
type_parameters
< "<"
type_parameter
type_identifier "R"
trait_bounds
: ":"
type_identifier "Runtime"
> ">"
parameters (+33 nodes collapsed)
-> "->"
generic_type
type_identifier "Result"
type_arguments
< "<"
unit_type
( "("
) ")"
> ">"
block
{ "{"
call_expression
field_expression
identifier "app"
. "."
field_identifier "emit_to"
arguments
( "("
identifier "target"
, ","
reference_expression
& "&"
identifier "event"
, ","
identifier "payload"
) ")"
} "}"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Initializes the event plugin.\n"
function_item (+71 nodes collapsed)

After

source_file
line_comment
// "//"
line_comment
// "//"
line_comment
// "//"
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "std"
:: "::"
identifier "ops"
:: "::"
identifier "Deref"
; ";"
use_declaration
use "use"
scoped_use_list
identifier "serde"
:: "::"
use_list
{ "{"
identifier "Deserialize"
, ","
identifier "Deserializer"
} "}"
; ";"
use_declaration
use "use"
use_as_clause
scoped_identifier
identifier "serde_json"
:: "::"
identifier "Value"
as "as"
identifier "JsonValue"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "tauri_runtime"
:: "::"
identifier "window"
:: "::"
identifier "is_label_valid"
; ";"
use_declaration
use "use"
scoped_use_list
scoped_identifier
crate "crate"
:: "::"
identifier "plugin"
:: "::"
use_list
{ "{"
identifier "Builder"
, ","
identifier "TauriPlugin"
} "}"
; ";"
use_declaration (+21 nodes collapsed)
use_declaration
use "use"
scoped_use_list
crate "crate"
:: "::"
use_list
{ "{"
identifier "AppHandle"
, ","
identifier "Emitter"
, ","
identifier "Webview"
} "}"
; ";"
use_declaration
use "use"
scoped_use_list
super "super"
:: "::"
use_list
{ "{"
identifier "is_event_name_valid"
, ","
identifier "EventTarget"
} "}"
; ";"
struct_item
visibility_modifier
pub "pub"
struct "struct"
type_identifier "EventName"
ordered_field_declaration_list
( "("
type_identifier "String"
) ")"
; ";"
impl_item (+39 nodes collapsed)
impl_item (+143 nodes collapsed)
struct_item
visibility_modifier
pub "pub"
struct "struct"
type_identifier "WebviewLabel"
ordered_field_declaration_list
( "("
type_identifier "String"
) ")"
; ";"
impl_item (+35 nodes collapsed)
impl_item (+143 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
identifier "command"
token_tree
( "("
identifier "root"
= "="
string_literal
" "\""
string_content "crate"
" "\""
) ")"
] "]"
function_item
visibility_modifier
pub "pub"
function_modifiers
async "async"
fn "fn"
identifier "listen"
type_parameters
< "<"
type_parameter
type_identifier "R"
trait_bounds
: ":"
type_identifier "Runtime"
> ">"
parameters (+28 nodes collapsed)
-> "->"
generic_type
type_identifier "Result"
type_arguments
< "<"
type_identifier "EventId"
> ">"
block
{ "{"
call_expression
field_expression
identifier "webview"
. "."
field_identifier "listen_js"
arguments
( "("
reference_expression
& "&"
identifier "event"
, ","
identifier "target"
, ","
identifier "handler"
) ")"
} "}"
attribute_item
# "#"
[ "["
attribute
identifier "command"
token_tree
( "("
identifier "root"
= "="
string_literal
" "\""
string_content "crate"
" "\""
) ")"
] "]"
function_item
visibility_modifier
pub "pub"
function_modifiers
async "async"
fn "fn"
identifier "unlisten"
type_parameters
< "<"
type_parameter
type_identifier "R"
trait_bounds
: ":"
type_identifier "Runtime"
> ">"
parameters (+23 nodes collapsed)
-> "->"
generic_type
type_identifier "Result"
type_arguments
< "<"
unit_type
( "("
) ")"
> ">"
block
{ "{"
call_expression
field_expression
identifier "webview"
. "."
field_identifier "unlisten_js"
arguments
( "("
reference_expression
& "&"
identifier "event"
, ","
identifier "event_id"
) ")"
} "}"
attribute_item
# "#"
[ "["
attribute
identifier "command"
token_tree
( "("
identifier "root"
= "="
string_literal
" "\""
string_content "crate"
" "\""
) ")"
] "]"
function_item
visibility_modifier
pub "pub"
function_modifiers
async "async"
fn "fn"
identifier "emit"
type_parameters
< "<"
type_parameter
type_identifier "R"
trait_bounds
: ":"
type_identifier "Runtime"
> ">"
parameters (+28 nodes collapsed)
-> "->"
generic_type
type_identifier "Result"
type_arguments
< "<"
unit_type
( "("
) ")"
> ">"
block
{ "{"
call_expression
field_expression
identifier "app"
. "."
field_identifier "emit"
arguments
( "("
reference_expression
& "&"
identifier "event"
, ","
identifier "payload"
) ")"
} "}"
attribute_item
# "#"
[ "["
attribute
identifier "command"
token_tree
( "("
identifier "root"
= "="
string_literal
" "\""
string_content "crate"
" "\""
) ")"
] "]"
function_item
visibility_modifier
pub "pub"
function_modifiers
async "async"
fn "fn"
identifier "emit_to"
type_parameters
< "<"
type_parameter
type_identifier "R"
trait_bounds
: ":"
type_identifier "Runtime"
> ">"
parameters (+33 nodes collapsed)
-> "->"
generic_type
type_identifier "Result"
type_arguments
< "<"
unit_type
( "("
) ")"
> ">"
block
{ "{"
call_expression
field_expression
identifier "app"
. "."
field_identifier "emit_to"
arguments
( "("
identifier "target"
, ","
reference_expression
& "&"
identifier "event"
, ","
identifier "payload"
) ")"
} "}"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Initializes the event plugin.\n"
function_item (+71 nodes collapsed)