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–18 unchanged (18 lines)
19 html::{SCRIPT_NONCE_TOKEN, STYLE_NONCE_TOKEN},
20};
21
22use crate::{
23 app::{AppHandle, GlobalWebviewEventListener, GlobalWindowEventListener, OnPageLoad},
24 event::{assert_event_name_is_valid, Event, EventId, EventTarget, Listeners},
25 ipc::{Invoke, InvokeHandler, InvokeResponder, RuntimeAuthority},
26 plugin::PluginStore,
27 utils::{config::Config, PackageInfo},
28 Assets, Context, Pattern, Runtime, StateManager, Window,
29};
30use crate::{event::EmitArgs, resources::ResourceTable, Webview};
31
…lines 32–250 unchanged (219 lines)
251 window_event_listeners: Vec<GlobalWindowEventListener<R>>,
252 webiew_event_listeners: Vec<GlobalWebviewEventListener<R>>,
253 #[cfg(desktop)] window_menu_event_listeners: HashMap<
254 String,
255 crate::app::GlobalMenuEventListener<Window<R>>,
256 >,
257 (invoke_responder, invoke_initialization_script): (Option<Arc<InvokeResponder<R>>>, String),
258 invoke_key: String,
259 ) -> Self {
260 // generate a random isolation key at runtime
261 #[cfg(feature = "isolation")]
262 if let Pattern::Isolation { ref mut key, .. } = &mut context.pattern {
263 *key = uuid::Uuid::new_v4().to_string();
…lines 264–272 unchanged (9 lines)
273 webview: webview::WebviewManager {
274 webviews: Mutex::default(),
275 invoke_handler,
276 on_page_load,
277 uri_scheme_protocols: Mutex::new(uri_scheme_protocols),
278 event_listeners: Arc::new(webiew_event_listeners),
279 invoke_responder,
280 invoke_initialization_script,
281 invoke_key: invoke_key.clone(),
282 },
283 #[cfg(all(desktop, feature = "tray-icon"))]
284 tray: tray::TrayManager {
285 icon: context.tray_icon,
…lines 286–727 unchanged (442 lines)
728 None,
729 Default::default(),
730 StateManager::new(),
731 Default::default(),
732 Default::default(),
733 Default::default(),
734 (None, "".into()),
735 crate::generate_invoke_key().unwrap(),
736 );
737
738 #[cfg(custom_protocol)]
739 {
740 assert_eq!(
…lines 741–984 unchanged (244 lines)

After

…lines 1–18 unchanged (18 lines)
19 html::{SCRIPT_NONCE_TOKEN, STYLE_NONCE_TOKEN},
20};
21
22use crate::{
23 app::{AppHandle, GlobalWebviewEventListener, GlobalWindowEventListener, OnPageLoad},
24 event::{assert_event_name_is_valid, Event, EventId, EventTarget, Listeners},
25 ipc::{Invoke, InvokeHandler, RuntimeAuthority},
26 plugin::PluginStore,
27 utils::{config::Config, PackageInfo},
28 Assets, Context, Pattern, Runtime, StateManager, Window,
29};
30use crate::{event::EmitArgs, resources::ResourceTable, Webview};
31
…lines 32–250 unchanged (219 lines)
251 window_event_listeners: Vec<GlobalWindowEventListener<R>>,
252 webiew_event_listeners: Vec<GlobalWebviewEventListener<R>>,
253 #[cfg(desktop)] window_menu_event_listeners: HashMap<
254 String,
255 crate::app::GlobalMenuEventListener<Window<R>>,
256 >,
257 invoke_initialization_script: String,
258 invoke_key: String,
259 ) -> Self {
260 // generate a random isolation key at runtime
261 #[cfg(feature = "isolation")]
262 if let Pattern::Isolation { ref mut key, .. } = &mut context.pattern {
263 *key = uuid::Uuid::new_v4().to_string();
…lines 264–272 unchanged (9 lines)
273 webview: webview::WebviewManager {
274 webviews: Mutex::default(),
275 invoke_handler,
276 on_page_load,
277 uri_scheme_protocols: Mutex::new(uri_scheme_protocols),
278 event_listeners: Arc::new(webiew_event_listeners),
279 invoke_initialization_script,
280 invoke_key: invoke_key.clone(),
281 },
282 #[cfg(all(desktop, feature = "tray-icon"))]
283 tray: tray::TrayManager {
284 icon: context.tray_icon,
285 icons: Default::default(),
…lines 286–726 unchanged (441 lines)
727 None,
728 Default::default(),
729 StateManager::new(),
730 Default::default(),
731 Default::default(),
732 Default::default(),
733 "".into(),
734 crate::generate_invoke_key().unwrap(),
735 );
736
737 #[cfg(custom_protocol)]
738 {
739 assert_eq!(
…lines 740–983 unchanged (244 lines)

Before

source_file
line_comment
// "//"
line_comment
// "//"
line_comment
// "//"
use_declaration (+33 nodes collapsed)
use_declaration
use "use"
scoped_identifier
identifier "serde"
:: "::"
identifier "Serialize"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "url"
:: "::"
identifier "Url"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "tauri_macros"
:: "::"
identifier "default_runtime"
; ";"
use_declaration (+39 nodes collapsed)
use_declaration
use "use"
scoped_use_list
crate "crate"
:: "::"
use_list
{ "{"
scoped_use_list
identifier "app"
:: "::"
use_list
{ "{"
identifier "AppHandle"
, ","
identifier "GlobalWebviewEventListener"
, ","
identifier "GlobalWindowEventListener"
, ","
identifier "OnPageLoad"
} "}"
, ","
scoped_use_list
identifier "event"
:: "::"
use_list
{ "{"
identifier "assert_event_name_is_valid"
, ","
identifier "Event"
, ","
identifier "EventId"
, ","
identifier "EventTarget"
, ","
identifier "Listeners"
} "}"
, ","
scoped_use_list
identifier "ipc"
:: "::"
use_list
{ "{"
identifier "Invoke"
, ","
identifier "InvokeHandler"
, ","
identifier "InvokeResponder"
, ","
identifier "RuntimeAuthority"
} "}"
, ","
scoped_identifier
identifier "plugin"
:: "::"
identifier "PluginStore"
, ","
scoped_use_list
identifier "utils"
:: "::"
use_list
{ "{"
scoped_identifier
identifier "config"
:: "::"
identifier "Config"
, ","
identifier "PackageInfo"
} "}"
, ","
identifier "Assets"
, ","
identifier "Context"
, ","
identifier "Pattern"
, ","
identifier "Runtime"
, ","
identifier "StateManager"
, ","
identifier "Window"
, ","
} "}"
; ";"
use_declaration
use "use"
scoped_use_list
crate "crate"
:: "::"
use_list
{ "{"
scoped_identifier
identifier "event"
:: "::"
identifier "EmitArgs"
, ","
scoped_identifier
identifier "resources"
:: "::"
identifier "ResourceTable"
, ","
identifier "Webview"
} "}"
; ";"
attribute_item
# "#"
[ "["
attribute
identifier "cfg"
token_tree
( "("
identifier "desktop"
) ")"
] "]"
mod_item
mod "mod"
identifier "menu"
; ";"
attribute_item (+21 nodes collapsed)
mod_item
mod "mod"
identifier "tray"
; ";"
mod_item
visibility_modifier
pub "pub"
mod "mod"
identifier "webview"
; ";"
mod_item
visibility_modifier
pub "pub"
mod "mod"
identifier "window"
; ";"
attribute_item
# "#"
[ "["
attribute
identifier "derive"
token_tree
( "("
identifier "Default"
) ")"
] "]"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Spaced and quoted Content-Security-Policy hash values.\n"
struct_item (+26 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Sets the CSP value to the asset HTML if needed (on Linux).\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Returns the CSP string for access on the response header (o"...
attribute_item
# "#"
[ "["
attribute
identifier "allow"
token_tree
( "("
identifier "clippy"
:: "::"
identifier "borrowed_box"
) ")"
] "]"
function_item (+368 nodes collapsed)
line_comment
// "//"
function_item (+183 nodes collapsed)
function_item (+410 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " A resolved asset.\n"
attribute_item
# "#"
[ "["
attribute
identifier "non_exhaustive"
] "]"
struct_item (+54 nodes collapsed)
impl_item (+106 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
identifier "default_runtime"
token_tree
( "("
crate "crate"
:: "::"
identifier "Wry"
, ","
identifier "wry"
) ")"
] "]"
struct_item (+328 nodes collapsed)
impl_item (+260 nodes collapsed)
impl_item
impl "impl"
type_parameters
< "<"
type_parameter
type_identifier "R"
trait_bounds
: ":"
type_identifier "Runtime"
> ">"
generic_type
type_identifier "AppManager"
type_arguments
< "<"
type_identifier "R"
> ">"
declaration_list
{ "{"
attribute_item
# "#"
[ "["
attribute
identifier "allow"
token_tree
( "("
identifier "clippy"
:: "::"
identifier "too_many_arguments"
, ","
identifier "clippy"
:: "::"
identifier "type_complexity"
) ")"
] "]"
function_item
visibility_modifier
pub "pub"
( "("
crate "crate"
) ")"
fn "fn"
identifier "with_handlers"
parameters
( "("
attribute_item
# "#"
[ "["
attribute
identifier "allow"
token_tree
( "("
identifier "unused_mut"
) ")"
] "]"
parameter
mutable_specifier "mut"
identifier "context"
: ":"
generic_type
type_identifier "Context"
type_arguments
< "<"
type_identifier "R"
> ">"
, ","
parameter
identifier "plugins"
: ":"
generic_type
type_identifier "PluginStore"
type_arguments
< "<"
type_identifier "R"
> ">"
, ","
parameter
identifier "invoke_handler"
: ":"
generic_type
type_identifier "Box"
type_arguments
< "<"
generic_type
type_identifier "InvokeHandler"
type_arguments
< "<"
type_identifier "R"
> ">"
> ">"
, ","
parameter
identifier "on_page_load"
: ":"
generic_type
type_identifier "Option"
type_arguments
< "<"
generic_type
type_identifier "Arc"
type_arguments
< "<"
generic_type
type_identifier "OnPageLoad"
type_arguments
< "<"
type_identifier "R"
> ">"
> ">"
> ">"
, ","
parameter (+24 nodes collapsed)
, ","
parameter
identifier "state"
: ":"
type_identifier "StateManager"
, ","
parameter
identifier "window_event_listeners"
: ":"
generic_type
type_identifier "Vec"
type_arguments
< "<"
generic_type
type_identifier "GlobalWindowEventListener"
type_arguments
< "<"
type_identifier "R"
> ">"
> ">"
, ","
parameter
identifier "webiew_event_listeners"
: ":"
generic_type
type_identifier "Vec"
type_arguments
< "<"
generic_type
type_identifier "GlobalWebviewEventListener"
type_arguments
< "<"
type_identifier "R"
> ">"
> ">"
, ","
attribute_item
# "#"
[ "["
attribute
identifier "cfg"
token_tree
( "("
identifier "desktop"
) ")"
] "]"
parameter (+28 nodes collapsed)
, ","
parameter
tuple_pattern
( "("
identifier "invoke_responder"
, ","
identifier "invoke_initialization_script"
) ")"
: ":"
tuple_type
( "("
generic_type
type_identifier "Option"
type_arguments
< "<"
generic_type
type_identifier "Arc"
type_arguments
< "<"
generic_type
type_identifier "InvokeResponder"
type_arguments
< "<"
type_identifier "R"
> ">"
> ">"
> ">"
, ","
type_identifier "String"
) ")"
, ","
parameter
identifier "invoke_key"
: ":"
type_identifier "String"
, ","
) ")"
-> "->"
type_identifier "Self"
block
{ "{"
line_comment
// "//"
attribute_item
# "#"
[ "["
attribute
identifier "cfg"
token_tree
( "("
identifier "feature"
= "="
string_literal
" "\""
string_content "isolation"
" "\""
) ")"
] "]"
expression_statement (+55 nodes collapsed)
struct_expression
type_identifier "Self"
field_initializer_list
{ "{"
field_initializer
field_identifier "runtime_authority"
: ":"
call_expression
scoped_identifier
identifier "Mutex"
:: "::"
identifier "new"
arguments
( "("
field_expression
identifier "context"
. "."
field_identifier "runtime_authority"
) ")"
, ","
field_initializer (+44 nodes collapsed)
, ","
field_initializer
field_identifier "webview"
: ":"
struct_expression
scoped_type_identifier
identifier "webview"
:: "::"
type_identifier "WebviewManager"
field_initializer_list
{ "{"
field_initializer
field_identifier "webviews"
: ":"
call_expression
scoped_identifier
identifier "Mutex"
:: "::"
identifier "default"
arguments
( "("
) ")"
, ","
shorthand_field_initializer
identifier "invoke_handler"
, ","
shorthand_field_initializer
identifier "on_page_load"
, ","
field_initializer
field_identifier "uri_scheme_protocols"
: ":"
call_expression
scoped_identifier
identifier "Mutex"
:: "::"
identifier "new"
arguments
( "("
identifier "uri_scheme_protocols"
) ")"
, ","
field_initializer
field_identifier "event_listeners"
: ":"
call_expression
scoped_identifier
identifier "Arc"
:: "::"
identifier "new"
arguments
( "("
identifier "webiew_event_listeners"
) ")"
, ","
shorthand_field_initializer
identifier "invoke_responder"
, ","
shorthand_field_initializer
identifier "invoke_initialization_script"
, ","
field_initializer
field_identifier "invoke_key"
: ":"
call_expression
field_expression
identifier "invoke_key"
. "."
field_identifier "clone"
arguments
( "("
) ")"
, ","
} "}"
, ","
field_initializer (+76 nodes collapsed)
, ","
field_initializer (+70 nodes collapsed)
, ","
field_initializer
field_identifier "plugins"
: ":"
call_expression
scoped_identifier
identifier "Mutex"
:: "::"
identifier "new"
arguments
( "("
identifier "plugins"
) ")"
, ","
field_initializer
field_identifier "listeners"
: ":"
call_expression
scoped_identifier
identifier "Listeners"
:: "::"
identifier "default"
arguments
( "("
) ")"
, ","
field_initializer
field_identifier "state"
: ":"
call_expression
scoped_identifier
identifier "Arc"
:: "::"
identifier "new"
arguments
( "("
identifier "state"
) ")"
, ","
field_initializer
field_identifier "config"
: ":"
field_expression
identifier "context"
. "."
field_identifier "config"
, ","
field_initializer
attribute_item
# "#"
[ "["
attribute
identifier "cfg"
token_tree
( "("
identifier "dev"
) ")"
] "]"
field_identifier "config_parent"
: ":"
field_expression
identifier "context"
. "."
field_identifier "config_parent"
, ","
field_initializer
field_identifier "assets"
: ":"
field_expression
identifier "context"
. "."
field_identifier "assets"
, ","
field_initializer
field_identifier "app_icon"
: ":"
field_expression
identifier "context"
. "."
field_identifier "app_icon"
, ","
field_initializer
field_identifier "package_info"
: ":"
field_expression
identifier "context"
. "."
field_identifier "package_info"
, ","
field_initializer
field_identifier "pattern"
: ":"
call_expression
scoped_identifier
identifier "Arc"
:: "::"
identifier "new"
arguments
( "("
field_expression
identifier "context"
. "."
field_identifier "pattern"
) ")"
, ","
field_initializer
field_identifier "plugin_global_api_scripts"
: ":"
call_expression
scoped_identifier
identifier "Arc"
:: "::"
identifier "new"
arguments
( "("
field_expression
identifier "context"
. "."
field_identifier "plugin_global_api_scripts"
) ")"
, ","
field_initializer
field_identifier "resources_table"
: ":"
call_expression
scoped_identifier
identifier "Arc"
:: "::"
identifier "default"
arguments
( "("
) ")"
, ","
shorthand_field_initializer
identifier "invoke_key"
, ","
} "}"
} "}"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " State managed by the application.\n"
function_item (+35 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Get the base path to serve data from.\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment "\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " * In dev mode, this will be based on the `devUrl` configura"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " * Otherwise, this will be based on the `frontendDist` confi"...
attribute_item
# "#"
[ "["
attribute
identifier "cfg"
token_tree
( "("
identifier "not"
token_tree
( "("
identifier "dev"
) ")"
) ")"
] "]"
function_item (+85 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
identifier "cfg"
token_tree
( "("
identifier "dev"
) ")"
] "]"
function_item (+38 nodes collapsed)
function_item (+114 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Get the base URL to use for webview requests.\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment "\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " In dev mode, this will be based on the `devUrl` configurati"...
function_item (+73 nodes collapsed)
function_item (+111 nodes collapsed)
function_item (+900 nodes collapsed)
function_item (+27 nodes collapsed)
function_item (+41 nodes collapsed)
function_item (+65 nodes collapsed)
function_item (+78 nodes collapsed)
function_item (+24 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
identifier "cfg"
token_tree
( "("
identifier "dev"
) ")"
] "]"
function_item (+40 nodes collapsed)
function_item (+24 nodes collapsed)
function_item (+81 nodes collapsed)
function_item (+81 nodes collapsed)
function_item (+35 nodes collapsed)
attribute_item (+34 nodes collapsed)
function_item (+184 nodes collapsed)
attribute_item (+36 nodes collapsed)
function_item (+229 nodes collapsed)
attribute_item (+42 nodes collapsed)
function_item (+282 nodes collapsed)
function_item (+59 nodes collapsed)
function_item (+99 nodes collapsed)
function_item (+107 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
identifier "cfg"
token_tree
( "("
identifier "desktop"
) ")"
] "]"
function_item (+105 nodes collapsed)
function_item (+46 nodes collapsed)
function_item (+59 nodes collapsed)
function_item (+46 nodes collapsed)
function_item (+50 nodes collapsed)
function_item (+27 nodes collapsed)
} "}"
attribute_item
# "#"
[ "["
attribute
identifier "cfg"
token_tree
( "("
identifier "desktop"
) ")"
] "]"
impl_item (+157 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
identifier "cfg"
token_tree
( "("
identifier "test"
) ")"
] "]"
mod_item (+126 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
identifier "cfg"
token_tree
( "("
identifier "test"
) ")"
] "]"
mod_item
mod "mod"
identifier "test"
declaration_list
{ "{"
use_declaration (+29 nodes collapsed)
use_declaration (+61 nodes collapsed)
use_declaration
use "use"
scoped_identifier
super "super"
:: "::"
identifier "AppManager"
; ";"
const_item
const "const"
identifier "APP_LISTEN_ID"
: ":"
reference_type
& "&"
primitive_type "str"
= "="
string_literal
" "\""
string_content "App::listen"
" "\""
; ";"
const_item
const "const"
identifier "APP_LISTEN_ANY_ID"
: ":"
reference_type
& "&"
primitive_type "str"
= "="
string_literal
" "\""
string_content "App::listen_any"
" "\""
; ";"
const_item
const "const"
identifier "WINDOW_LISTEN_ID"
: ":"
reference_type
& "&"
primitive_type "str"
= "="
string_literal
" "\""
string_content "Window::listen"
" "\""
; ";"
const_item
const "const"
identifier "WINDOW_LISTEN_ANY_ID"
: ":"
reference_type
& "&"
primitive_type "str"
= "="
string_literal
" "\""
string_content "Window::listen_any"
" "\""
; ";"
const_item
const "const"
identifier "WEBVIEW_LISTEN_ID"
: ":"
reference_type
& "&"
primitive_type "str"
= "="
string_literal
" "\""
string_content "Webview::listen"
" "\""
; ";"
const_item
const "const"
identifier "WEBVIEW_LISTEN_ANY_ID"
: ":"
reference_type
& "&"
primitive_type "str"
= "="
string_literal
" "\""
string_content "Webview::listen_any"
" "\""
; ";"
const_item
const "const"
identifier "WEBVIEW_WINDOW_LISTEN_ID"
: ":"
reference_type
& "&"
primitive_type "str"
= "="
string_literal
" "\""
string_content "WebviewWindow::listen"
" "\""
; ";"
const_item
const "const"
identifier "WEBVIEW_WINDOW_LISTEN_ANY_ID"
: ":"
reference_type
& "&"
primitive_type "str"
= "="
string_literal
" "\""
string_content "WebviewWindow::listen_any"
" "\""
; ";"
const_item
const "const"
identifier "TEST_EVENT_NAME"
: ":"
reference_type
& "&"
primitive_type "str"
= "="
string_literal
" "\""
string_content "event"
" "\""
; ";"
attribute_item
# "#"
[ "["
attribute
identifier "test"
] "]"
function_item
fn "fn"
identifier "check_get_url"
parameters
( "("
) ")"
block
{ "{"
let_declaration (+22 nodes collapsed)
let_declaration
let "let"
identifier "manager"
: ":"
generic_type
type_identifier "AppManager"
type_arguments
< "<"
type_identifier "Wry"
> ">"
= "="
call_expression
scoped_identifier
identifier "AppManager"
:: "::"
identifier "with_handlers"
arguments
( "("
identifier "context"
, ","
call_expression
scoped_identifier
identifier "PluginStore"
:: "::"
identifier "default"
arguments
( "("
) ")"
, ","
call_expression
scoped_identifier
identifier "Box"
:: "::"
identifier "new"
arguments
( "("
closure_expression
closure_parameters
| "|"
_ "_"
| "|"
boolean_literal
false "false"
) ")"
, ","
identifier "None"
, ","
call_expression
scoped_identifier
identifier "Default"
:: "::"
identifier "default"
arguments
( "("
) ")"
, ","
call_expression
scoped_identifier
identifier "StateManager"
:: "::"
identifier "new"
arguments
( "("
) ")"
, ","
call_expression
scoped_identifier
identifier "Default"
:: "::"
identifier "default"
arguments
( "("
) ")"
, ","
call_expression
scoped_identifier
identifier "Default"
:: "::"
identifier "default"
arguments
( "("
) ")"
, ","
call_expression
scoped_identifier
identifier "Default"
:: "::"
identifier "default"
arguments
( "("
) ")"
, ","
tuple_expression
( "("
identifier "None"
, ","
call_expression
field_expression
string_literal
" "\""
" "\""
. "."
field_identifier "into"
arguments
( "("
) ")"
) ")"
, ","
call_expression
field_expression
call_expression
scoped_identifier
crate "crate"
:: "::"
identifier "generate_invoke_key"
arguments
( "("
) ")"
. "."
field_identifier "unwrap"
arguments
( "("
) ")"
, ","
) ")"
; ";"
attribute_item
# "#"
[ "["
attribute
identifier "cfg"
token_tree
( "("
identifier "custom_protocol"
) ")"
] "]"
expression_statement (+58 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
identifier "cfg"
token_tree
( "("
identifier "dev"
) ")"
] "]"
expression_statement (+24 nodes collapsed)
} "}"
struct_item (+86 nodes collapsed)
function_item (+432 nodes collapsed)
function_item (+94 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
identifier "test"
] "]"
function_item (+112 nodes collapsed)
function_item (+196 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
identifier "test"
] "]"
function_item (+206 nodes collapsed)
function_item (+565 nodes collapsed)
} "}"

After

source_file
line_comment
// "//"
line_comment
// "//"
line_comment
// "//"
use_declaration (+33 nodes collapsed)
use_declaration
use "use"
scoped_identifier
identifier "serde"
:: "::"
identifier "Serialize"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "url"
:: "::"
identifier "Url"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "tauri_macros"
:: "::"
identifier "default_runtime"
; ";"
use_declaration (+39 nodes collapsed)
use_declaration
use "use"
scoped_use_list
crate "crate"
:: "::"
use_list
{ "{"
scoped_use_list
identifier "app"
:: "::"
use_list
{ "{"
identifier "AppHandle"
, ","
identifier "GlobalWebviewEventListener"
, ","
identifier "GlobalWindowEventListener"
, ","
identifier "OnPageLoad"
} "}"
, ","
scoped_use_list
identifier "event"
:: "::"
use_list
{ "{"
identifier "assert_event_name_is_valid"
, ","
identifier "Event"
, ","
identifier "EventId"
, ","
identifier "EventTarget"
, ","
identifier "Listeners"
} "}"
, ","
scoped_use_list
identifier "ipc"
:: "::"
use_list
{ "{"
identifier "Invoke"
, ","
identifier "InvokeHandler"
, ","
identifier "RuntimeAuthority"
} "}"
, ","
scoped_identifier
identifier "plugin"
:: "::"
identifier "PluginStore"
, ","
scoped_use_list
identifier "utils"
:: "::"
use_list
{ "{"
scoped_identifier
identifier "config"
:: "::"
identifier "Config"
, ","
identifier "PackageInfo"
} "}"
, ","
identifier "Assets"
, ","
identifier "Context"
, ","
identifier "Pattern"
, ","
identifier "Runtime"
, ","
identifier "StateManager"
, ","
identifier "Window"
, ","
} "}"
; ";"
use_declaration
use "use"
scoped_use_list
crate "crate"
:: "::"
use_list
{ "{"
scoped_identifier
identifier "event"
:: "::"
identifier "EmitArgs"
, ","
scoped_identifier
identifier "resources"
:: "::"
identifier "ResourceTable"
, ","
identifier "Webview"
} "}"
; ";"
attribute_item
# "#"
[ "["
attribute
identifier "cfg"
token_tree
( "("
identifier "desktop"
) ")"
] "]"
mod_item
mod "mod"
identifier "menu"
; ";"
attribute_item (+21 nodes collapsed)
mod_item
mod "mod"
identifier "tray"
; ";"
mod_item
visibility_modifier
pub "pub"
mod "mod"
identifier "webview"
; ";"
mod_item
visibility_modifier
pub "pub"
mod "mod"
identifier "window"
; ";"
attribute_item
# "#"
[ "["
attribute
identifier "derive"
token_tree
( "("
identifier "Default"
) ")"
] "]"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Spaced and quoted Content-Security-Policy hash values.\n"
struct_item (+26 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Sets the CSP value to the asset HTML if needed (on Linux).\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Returns the CSP string for access on the response header (o"...
attribute_item
# "#"
[ "["
attribute
identifier "allow"
token_tree
( "("
identifier "clippy"
:: "::"
identifier "borrowed_box"
) ")"
] "]"
function_item (+368 nodes collapsed)
line_comment
// "//"
function_item (+183 nodes collapsed)
function_item (+410 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " A resolved asset.\n"
attribute_item
# "#"
[ "["
attribute
identifier "non_exhaustive"
] "]"
struct_item (+54 nodes collapsed)
impl_item (+106 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
identifier "default_runtime"
token_tree
( "("
crate "crate"
:: "::"
identifier "Wry"
, ","
identifier "wry"
) ")"
] "]"
struct_item (+328 nodes collapsed)
impl_item (+260 nodes collapsed)
impl_item
impl "impl"
type_parameters
< "<"
type_parameter
type_identifier "R"
trait_bounds
: ":"
type_identifier "Runtime"
> ">"
generic_type
type_identifier "AppManager"
type_arguments
< "<"
type_identifier "R"
> ">"
declaration_list
{ "{"
attribute_item
# "#"
[ "["
attribute
identifier "allow"
token_tree
( "("
identifier "clippy"
:: "::"
identifier "too_many_arguments"
, ","
identifier "clippy"
:: "::"
identifier "type_complexity"
) ")"
] "]"
function_item
visibility_modifier
pub "pub"
( "("
crate "crate"
) ")"
fn "fn"
identifier "with_handlers"
parameters
( "("
attribute_item
# "#"
[ "["
attribute
identifier "allow"
token_tree
( "("
identifier "unused_mut"
) ")"
] "]"
parameter
mutable_specifier "mut"
identifier "context"
: ":"
generic_type
type_identifier "Context"
type_arguments
< "<"
type_identifier "R"
> ">"
, ","
parameter
identifier "plugins"
: ":"
generic_type
type_identifier "PluginStore"
type_arguments
< "<"
type_identifier "R"
> ">"
, ","
parameter
identifier "invoke_handler"
: ":"
generic_type
type_identifier "Box"
type_arguments
< "<"
generic_type
type_identifier "InvokeHandler"
type_arguments
< "<"
type_identifier "R"
> ">"
> ">"
, ","
parameter
identifier "on_page_load"
: ":"
generic_type
type_identifier "Option"
type_arguments
< "<"
generic_type
type_identifier "Arc"
type_arguments
< "<"
generic_type
type_identifier "OnPageLoad"
type_arguments
< "<"
type_identifier "R"
> ">"
> ">"
> ">"
, ","
parameter (+24 nodes collapsed)
, ","
parameter
identifier "state"
: ":"
type_identifier "StateManager"
, ","
parameter
identifier "window_event_listeners"
: ":"
generic_type
type_identifier "Vec"
type_arguments
< "<"
generic_type
type_identifier "GlobalWindowEventListener"
type_arguments
< "<"
type_identifier "R"
> ">"
> ">"
, ","
parameter
identifier "webiew_event_listeners"
: ":"
generic_type
type_identifier "Vec"
type_arguments
< "<"
generic_type
type_identifier "GlobalWebviewEventListener"
type_arguments
< "<"
type_identifier "R"
> ">"
> ">"
, ","
attribute_item
# "#"
[ "["
attribute
identifier "cfg"
token_tree
( "("
identifier "desktop"
) ")"
] "]"
parameter (+28 nodes collapsed)
, ","
parameter
identifier "invoke_initialization_script"
: ":"
type_identifier "String"
, ","
parameter
identifier "invoke_key"
: ":"
type_identifier "String"
, ","
) ")"
-> "->"
type_identifier "Self"
block
{ "{"
line_comment
// "//"
attribute_item
# "#"
[ "["
attribute
identifier "cfg"
token_tree
( "("
identifier "feature"
= "="
string_literal
" "\""
string_content "isolation"
" "\""
) ")"
] "]"
expression_statement (+55 nodes collapsed)
struct_expression
type_identifier "Self"
field_initializer_list
{ "{"
field_initializer
field_identifier "runtime_authority"
: ":"
call_expression
scoped_identifier
identifier "Mutex"
:: "::"
identifier "new"
arguments
( "("
field_expression
identifier "context"
. "."
field_identifier "runtime_authority"
) ")"
, ","
field_initializer (+44 nodes collapsed)
, ","
field_initializer
field_identifier "webview"
: ":"
struct_expression
scoped_type_identifier
identifier "webview"
:: "::"
type_identifier "WebviewManager"
field_initializer_list
{ "{"
field_initializer
field_identifier "webviews"
: ":"
call_expression
scoped_identifier
identifier "Mutex"
:: "::"
identifier "default"
arguments
( "("
) ")"
, ","
shorthand_field_initializer
identifier "invoke_handler"
, ","
shorthand_field_initializer
identifier "on_page_load"
, ","
field_initializer
field_identifier "uri_scheme_protocols"
: ":"
call_expression
scoped_identifier
identifier "Mutex"
:: "::"
identifier "new"
arguments
( "("
identifier "uri_scheme_protocols"
) ")"
, ","
field_initializer
field_identifier "event_listeners"
: ":"
call_expression
scoped_identifier
identifier "Arc"
:: "::"
identifier "new"
arguments
( "("
identifier "webiew_event_listeners"
) ")"
, ","
shorthand_field_initializer
identifier "invoke_initialization_script"
, ","
field_initializer
field_identifier "invoke_key"
: ":"
call_expression
field_expression
identifier "invoke_key"
. "."
field_identifier "clone"
arguments
( "("
) ")"
, ","
} "}"
, ","
field_initializer (+76 nodes collapsed)
, ","
field_initializer (+70 nodes collapsed)
, ","
field_initializer
field_identifier "plugins"
: ":"
call_expression
scoped_identifier
identifier "Mutex"
:: "::"
identifier "new"
arguments
( "("
identifier "plugins"
) ")"
, ","
field_initializer
field_identifier "listeners"
: ":"
call_expression
scoped_identifier
identifier "Listeners"
:: "::"
identifier "default"
arguments
( "("
) ")"
, ","
field_initializer
field_identifier "state"
: ":"
call_expression
scoped_identifier
identifier "Arc"
:: "::"
identifier "new"
arguments
( "("
identifier "state"
) ")"
, ","
field_initializer
field_identifier "config"
: ":"
field_expression
identifier "context"
. "."
field_identifier "config"
, ","
field_initializer
attribute_item
# "#"
[ "["
attribute
identifier "cfg"
token_tree
( "("
identifier "dev"
) ")"
] "]"
field_identifier "config_parent"
: ":"
field_expression
identifier "context"
. "."
field_identifier "config_parent"
, ","
field_initializer
field_identifier "assets"
: ":"
field_expression
identifier "context"
. "."
field_identifier "assets"
, ","
field_initializer
field_identifier "app_icon"
: ":"
field_expression
identifier "context"
. "."
field_identifier "app_icon"
, ","
field_initializer
field_identifier "package_info"
: ":"
field_expression
identifier "context"
. "."
field_identifier "package_info"
, ","
field_initializer
field_identifier "pattern"
: ":"
call_expression
scoped_identifier
identifier "Arc"
:: "::"
identifier "new"
arguments
( "("
field_expression
identifier "context"
. "."
field_identifier "pattern"
) ")"
, ","
field_initializer
field_identifier "plugin_global_api_scripts"
: ":"
call_expression
scoped_identifier
identifier "Arc"
:: "::"
identifier "new"
arguments
( "("
field_expression
identifier "context"
. "."
field_identifier "plugin_global_api_scripts"
) ")"
, ","
field_initializer
field_identifier "resources_table"
: ":"
call_expression
scoped_identifier
identifier "Arc"
:: "::"
identifier "default"
arguments
( "("
) ")"
, ","
shorthand_field_initializer
identifier "invoke_key"
, ","
} "}"
} "}"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " State managed by the application.\n"
function_item (+35 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Get the base path to serve data from.\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment "\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " * In dev mode, this will be based on the `devUrl` configura"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " * Otherwise, this will be based on the `frontendDist` confi"...
attribute_item
# "#"
[ "["
attribute
identifier "cfg"
token_tree
( "("
identifier "not"
token_tree
( "("
identifier "dev"
) ")"
) ")"
] "]"
function_item (+85 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
identifier "cfg"
token_tree
( "("
identifier "dev"
) ")"
] "]"
function_item (+38 nodes collapsed)
function_item (+114 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Get the base URL to use for webview requests.\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment "\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " In dev mode, this will be based on the `devUrl` configurati"...
function_item (+73 nodes collapsed)
function_item (+111 nodes collapsed)
function_item (+900 nodes collapsed)
function_item (+27 nodes collapsed)
function_item (+41 nodes collapsed)
function_item (+65 nodes collapsed)
function_item (+78 nodes collapsed)
function_item (+24 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
identifier "cfg"
token_tree
( "("
identifier "dev"
) ")"
] "]"
function_item (+40 nodes collapsed)
function_item (+24 nodes collapsed)
function_item (+81 nodes collapsed)
function_item (+81 nodes collapsed)
function_item (+35 nodes collapsed)
attribute_item (+34 nodes collapsed)
function_item (+184 nodes collapsed)
attribute_item (+36 nodes collapsed)
function_item (+229 nodes collapsed)
attribute_item (+42 nodes collapsed)
function_item (+282 nodes collapsed)
function_item (+59 nodes collapsed)
function_item (+99 nodes collapsed)
function_item (+107 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
identifier "cfg"
token_tree
( "("
identifier "desktop"
) ")"
] "]"
function_item (+105 nodes collapsed)
function_item (+46 nodes collapsed)
function_item (+59 nodes collapsed)
function_item (+46 nodes collapsed)
function_item (+50 nodes collapsed)
function_item (+27 nodes collapsed)
} "}"
attribute_item
# "#"
[ "["
attribute
identifier "cfg"
token_tree
( "("
identifier "desktop"
) ")"
] "]"
impl_item (+157 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
identifier "cfg"
token_tree
( "("
identifier "test"
) ")"
] "]"
mod_item (+126 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
identifier "cfg"
token_tree
( "("
identifier "test"
) ")"
] "]"
mod_item
mod "mod"
identifier "test"
declaration_list
{ "{"
use_declaration (+29 nodes collapsed)
use_declaration (+61 nodes collapsed)
use_declaration
use "use"
scoped_identifier
super "super"
:: "::"
identifier "AppManager"
; ";"
const_item
const "const"
identifier "APP_LISTEN_ID"
: ":"
reference_type
& "&"
primitive_type "str"
= "="
string_literal
" "\""
string_content "App::listen"
" "\""
; ";"
const_item
const "const"
identifier "APP_LISTEN_ANY_ID"
: ":"
reference_type
& "&"
primitive_type "str"
= "="
string_literal
" "\""
string_content "App::listen_any"
" "\""
; ";"
const_item
const "const"
identifier "WINDOW_LISTEN_ID"
: ":"
reference_type
& "&"
primitive_type "str"
= "="
string_literal
" "\""
string_content "Window::listen"
" "\""
; ";"
const_item
const "const"
identifier "WINDOW_LISTEN_ANY_ID"
: ":"
reference_type
& "&"
primitive_type "str"
= "="
string_literal
" "\""
string_content "Window::listen_any"
" "\""
; ";"
const_item
const "const"
identifier "WEBVIEW_LISTEN_ID"
: ":"
reference_type
& "&"
primitive_type "str"
= "="
string_literal
" "\""
string_content "Webview::listen"
" "\""
; ";"
const_item
const "const"
identifier "WEBVIEW_LISTEN_ANY_ID"
: ":"
reference_type
& "&"
primitive_type "str"
= "="
string_literal
" "\""
string_content "Webview::listen_any"
" "\""
; ";"
const_item
const "const"
identifier "WEBVIEW_WINDOW_LISTEN_ID"
: ":"
reference_type
& "&"
primitive_type "str"
= "="
string_literal
" "\""
string_content "WebviewWindow::listen"
" "\""
; ";"
const_item
const "const"
identifier "WEBVIEW_WINDOW_LISTEN_ANY_ID"
: ":"
reference_type
& "&"
primitive_type "str"
= "="
string_literal
" "\""
string_content "WebviewWindow::listen_any"
" "\""
; ";"
const_item
const "const"
identifier "TEST_EVENT_NAME"
: ":"
reference_type
& "&"
primitive_type "str"
= "="
string_literal
" "\""
string_content "event"
" "\""
; ";"
attribute_item
# "#"
[ "["
attribute
identifier "test"
] "]"
function_item
fn "fn"
identifier "check_get_url"
parameters
( "("
) ")"
block
{ "{"
let_declaration (+22 nodes collapsed)
let_declaration
let "let"
identifier "manager"
: ":"
generic_type
type_identifier "AppManager"
type_arguments
< "<"
type_identifier "Wry"
> ">"
= "="
call_expression
scoped_identifier
identifier "AppManager"
:: "::"
identifier "with_handlers"
arguments
( "("
identifier "context"
, ","
call_expression
scoped_identifier
identifier "PluginStore"
:: "::"
identifier "default"
arguments
( "("
) ")"
, ","
call_expression
scoped_identifier
identifier "Box"
:: "::"
identifier "new"
arguments
( "("
closure_expression
closure_parameters
| "|"
_ "_"
| "|"
boolean_literal
false "false"
) ")"
, ","
identifier "None"
, ","
call_expression
scoped_identifier
identifier "Default"
:: "::"
identifier "default"
arguments
( "("
) ")"
, ","
call_expression
scoped_identifier
identifier "StateManager"
:: "::"
identifier "new"
arguments
( "("
) ")"
, ","
call_expression
scoped_identifier
identifier "Default"
:: "::"
identifier "default"
arguments
( "("
) ")"
, ","
call_expression
scoped_identifier
identifier "Default"
:: "::"
identifier "default"
arguments
( "("
) ")"
, ","
call_expression
scoped_identifier
identifier "Default"
:: "::"
identifier "default"
arguments
( "("
) ")"
, ","
call_expression
field_expression
string_literal
" "\""
" "\""
. "."
field_identifier "into"
arguments
( "("
) ")"
, ","
call_expression
field_expression
call_expression
scoped_identifier
crate "crate"
:: "::"
identifier "generate_invoke_key"
arguments
( "("
) ")"
. "."
field_identifier "unwrap"
arguments
( "("
) ")"
, ","
) ")"
; ";"
attribute_item
# "#"
[ "["
attribute
identifier "cfg"
token_tree
( "("
identifier "custom_protocol"
) ")"
] "]"
expression_statement (+58 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
identifier "cfg"
token_tree
( "("
identifier "dev"
) ")"
] "]"
expression_statement (+24 nodes collapsed)
} "}"
struct_item (+86 nodes collapsed)
function_item (+432 nodes collapsed)
function_item (+94 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
identifier "test"
] "]"
function_item (+112 nodes collapsed)
function_item (+196 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
identifier "test"
] "]"
function_item (+206 nodes collapsed)
function_item (+565 nodes collapsed)
} "}"