File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " tauri " : patch
3+ ---
4+
5+ Expose mutable getters for the rest of the public ` Context ` getters.
6+ * ` pub fn assets_mut(&mut self) -> &mut Arc<A> `
7+ * ` pub fn default_window_icon_mut(&mut self) -> &mut Option<Vec<u8>> `
8+ * ` pub fn system_tray_icon_mut(&mut self) -> &mut Option<Icon> `
9+ * ` pub fn package_info_mut(&mut self) -> &mut tauri::api::PackageInfo `
Original file line number Diff line number Diff line change @@ -154,24 +154,48 @@ impl<A: Assets> Context<A> {
154154 self . assets . clone ( )
155155 }
156156
157+ /// A mutable reference to the assets to be served directly by Tauri.
158+ #[ inline( always) ]
159+ pub fn assets_mut ( & mut self ) -> & mut Arc < A > {
160+ & mut self . assets
161+ }
162+
157163 /// The default window icon Tauri should use when creating windows.
158164 #[ inline( always) ]
159165 pub fn default_window_icon ( & self ) -> Option < & [ u8 ] > {
160166 self . default_window_icon . as_deref ( )
161167 }
162168
163- /// The icon to use use on the system tray UI.
169+ /// A mutable reference to the default window icon Tauri should use when creating windows.
170+ #[ inline( always) ]
171+ pub fn default_window_icon_mut ( & mut self ) -> & mut Option < Vec < u8 > > {
172+ & mut self . default_window_icon
173+ }
174+
175+ /// The icon to use on the system tray UI.
164176 #[ inline( always) ]
165177 pub fn system_tray_icon ( & self ) -> Option < & Icon > {
166178 self . system_tray_icon . as_ref ( )
167179 }
168180
181+ /// A mutable reference to the icon to use on the system tray UI.
182+ #[ inline( always) ]
183+ pub fn system_tray_icon_mut ( & mut self ) -> & mut Option < Icon > {
184+ & mut self . system_tray_icon
185+ }
186+
169187 /// Package information.
170188 #[ inline( always) ]
171189 pub fn package_info ( & self ) -> & crate :: api:: PackageInfo {
172190 & self . package_info
173191 }
174192
193+ /// A mutable reference to the package information.
194+ #[ inline( always) ]
195+ pub fn package_info_mut ( & mut self ) -> & mut crate :: api:: PackageInfo {
196+ & mut self . package_info
197+ }
198+
175199 /// Create a new [`Context`] from the minimal required items.
176200 #[ inline( always) ]
177201 pub fn new (
You can’t perform that action at this time.
0 commit comments