pub struct Widget<R: Runtime> { /* private fields */ }Available on
desktop only.Implementations§
Source§impl<R: Runtime> Widget<R>
impl<R: Runtime> Widget<R>
pub fn set_items(&self, key: &str, value: &str, group: &str) -> Result<bool>
pub fn get_items(&self, key: &str, group: &str) -> Result<Option<String>>
pub fn create_widget_window(&self, config: WidgetWindowConfig) -> Result<bool>
pub fn close_widget_window(&self, label: &str) -> Result<bool>
Sourcepub fn set_register_widget(&self, _widgets: Vec<String>) -> Result<bool>
pub fn set_register_widget(&self, _widgets: Vec<String>) -> Result<bool>
Register native widget provider ids.
| Platform | Behaviour |
|---|---|
| Android | stores fully-qualified provider class names |
| iOS / macOS | stores WidgetKit kind strings (advisory) |
| Desktop | no-op, accepted for API symmetry |
pub fn reload_all_timelines(&self) -> Result<bool>
pub fn reload_timelines(&self, of_kind: &str) -> Result<bool>
Sourcepub fn request_widget(&self) -> Result<bool>
pub fn request_widget(&self) -> Result<bool>
Request that the OS show the “add widget” / pin UI.
| Platform | Behaviour |
|---|---|
| Android | opens the pin-widget flow |
| iOS / macOS | no native pin API — returns Ok from the mobile bridge |
| Desktop | error — use Self::create_widget_window instead |
pub fn set_widget_config( &self, config: &WidgetConfig, group: &str, widget_id: &str, skip_reload: bool, ) -> Result<ApplyOutcome>
pub fn get_widget_config( &self, group: &str, widget_id: &str, ) -> Result<Option<WidgetConfig>>
Sourcepub fn poll_pending_actions(
&self,
group: &str,
) -> Result<Vec<WidgetActionEnvelope>>
pub fn poll_pending_actions( &self, group: &str, ) -> Result<Vec<WidgetActionEnvelope>>
Drain pending actions for a group (CAS clear under store lock).
pub fn report_receipt(&self, receipt: WidgetRenderReceipt) -> Result<bool>
pub fn get_widget_diagnostics( &self, group: &str, ) -> Result<Vec<WidgetRenderReceipt>>
pub fn get_widget_trace( &self, group: &str, since_ms: Option<u64>, ) -> Result<WidgetTrace>
pub fn flush_widget_trace(&self) -> Result<bool>
Auto Trait Implementations§
impl<R> !Freeze for Widget<R>
impl<R> !RefUnwindSafe for Widget<R>
impl<R> !UnwindSafe for Widget<R>
impl<R> Send for Widget<R>
impl<R> Sync for Widget<R>
impl<R> Unpin for Widget<R>
impl<R> UnsafeUnpin for Widget<R>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more