Skip to main content

AppKit

Struct AppKit 

Source
pub struct AppKit { /* private fields */ }

Implementations§

Source§

impl AppKit

Source

pub fn new() -> Self

Create the AppKit toolkit with every registered renderer.

§Panics

Panics when called off the main thread.

Source

pub fn mtm(&self) -> MainThreadMarker

Public helper for external renderers.

Trait Implementations§

Source§

impl Default for AppKit

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Platform for AppKit

Source§

const TARGET: &'static str = "macos-appkit"

The process-constant target id, e.g. "macos-appkit".
Source§

const TOOLKIT: &'static str = "appkit"

The toolkit half of the target, e.g. "appkit".
Source§

fn run(self, options: WindowOptions, ready: Box<dyn FnOnce(Self, Handle, Size)>)

Source§

fn post(f: Box<dyn FnOnce() + Send>)

Post a closure onto the native main loop. Callable from any thread; this is the single door the reactive scheduler and Setter deliveries ride (§3.3).
Source§

fn post_delayed(ms: u32, f: Box<dyn FnOnce() + Send>)

Post f onto the native main loop after (at least) ms milliseconds: the timer door behind day::sleep (docs/async.md). Every shipped backend overrides it with the loop’s own timer (dispatch_after, Handler.postDelayed, g_timeout_add, QTimer::singleShot, SetTimer, setTimeout), so a sleep costs no thread. The default is the fallback for a backend without one: a helper thread that sleeps the whole delay and rides Platform::post home. It is correct, but a thread per sleep adds up under a ticking loop, so the first use says so once in the log.
Source§

fn locale_hints(&self) -> Vec<String>

Ordered OS locale preference list (BCP-47), for fluent-langneg (§12.2).
Source§

const RUN_ENDS_APP: bool = true

Whether Platform::run returning means the app is over. True for a backend that drives the native loop itself until the app quits (GTK, Qt, XAML; AppKit’s never returns). False where the host owns the loop and run hands back at once, with the app still to come (ArkUI’s ability, Android’s activity, the web page, the mock’s test): their DidExit is the host’s last callback, not the return (docs/lifecycle.md).
Source§

impl Toolkit for AppKit

Source§

fn ui_idle(&mut self) -> bool

Settled unless a toolbar edit is still painting (toolbar.rs CHROME_SETTLE); AppKit’s own transitions (sheets, nav pushes) complete within the turn that starts them.

Source§

fn system_color(&mut self, role: SystemColor) -> Color

Every role’s AppKit color (color::role_color), resolved in sRGB for the app’s effective appearance: what Palette::current holds and day::resolve answers.

Source§

fn reduce_motion(&mut self) -> bool

System Settings › Accessibility › Display › “Reduce motion”, as NSWorkspace reports it (docs/accessibility.md). install_reduce_motion_observer re-reads it on a flip.

Source§

fn set_app_badge(&mut self, badge: &AppBadge)

macOS is the one platform whose badge takes arbitrary text: NSDockTile.badgeLabel is a String, so Text renders literally and a count is just its decimal form. A nil label clears it (docs/badge.md).

Source§

fn release_piece(&mut self, kind: PieceKind, h: &Self::Handle)

Offer a satellite piece its teardown hook before release frees the handle (§15.2).

Source§

fn set_opacity(&mut self, h: &Handle, opacity: f64, anim: Option<&AnimSpec>)

The whole AnimSpec on the layer’s opacity (docs/tween.md; see motion).

Source§

fn read_displayed(&self, h: &Handle) -> Displayed

What the layer shows mid-animation (docs/tween.md “Toolkit support”; see motion).

Source§

fn text_scale(&mut self, _style: Font) -> f64

macOS has no system text-size setting that NSFont.preferredFont(forTextStyle:) follows, so every style is at its default size (docs/text.md “Text scale”).

Source§

fn set_layout_direction( &mut self, h: &Handle, kind: PieceKind, direction: LayoutDirection, )

A leaf control’s reading direction (docs/localization.md “Direction of a subtree”): userInterfaceLayoutDirection on the view and its cell (a slider’s fill side, a switch’s on side, a pop-up’s arrow), and for text the base writing direction, which NSTextAlignment.natural and Day’s Trailing follow. Containers, scroll views, lists and other hosts are skipped: Day places their children and mirrors them itself.

Source§

fn first_baseline( &mut self, h: &Handle, kind: PieceKind, size: Size, ) -> Option<f64>

Where the control actually draws its first line of text (docs/baseline.md).

AppKit publishes firstBaselineOffsetFromTop, but it is measured from the top of the view’s alignment rect and it is rounded to whole points, and that rounding is visible. An NSDatePicker in a 26pt frame insets its alignment rect 4pt and answers 15, i.e. 19 in frame terms, while it paints at 19.9; a label beside it then sits a point high, which is exactly the drift baseline alignment exists to remove.

So derive it from the metrics AppKit rounded: a single line of the control’s own font, centered in its alignment rect, with the baseline an ascender below the line’s top. That reproduces AppKit’s own numbers for a plain label and a bezeled field (12.91 → its 13, 19.91 → its 20) while keeping the fractional part that makes a picker land on the line. Controls with no font of their own keep AppKit’s answer.

Source§

fn list_row_metrics(&mut self, _h: &Handle) -> RowMetrics

A macOS table row: the dense rows of a Finder or Mail list, 28pt for an icon and a line of body text.

Source§

fn scroll_to(&mut self, h: &Handle, target: Rect, animated: bool)

The least scroll that shows target (scrollRectToVisible:’s rule), through the clip view’s animator when animated, else a jump that also stops a running animation.

Source§

fn list_scroll(&mut self, h: &Handle, to: ListScroll) -> bool

Place the row where to.align says from its rectOfRow: and the clip view’s bounds (docs/list.md “Programmatic scrolling”), animated through the clip view’s animator or a jump; then realize the rows it exposed and report the viewport. Deferred one turn, as the patches were: the scroll tiles rows synchronously, outside this borrow.

Source§

fn gesture_support(&self, kind: GestureKind) -> Support

Press, long press and double tap are AppKit’s own (see enable_gesture). Touches stay derived: a Mac’s pointer is one mouse, and a trackpad’s touches are not contacts on the screen.

Source§

fn set_drag_axis(&mut self, _h: &Handle, _node: NodeId, _axis: Option<DragAxis>)

Nothing to do on a Mac (docs/gestures.md “Gestures inside a scroll view”): an NSScrollView scrolls on the wheel and the trackpad’s two-finger scroll (scrollWheel:), never on a mouse drag, so a drag is never contested and a trackpad scroll over the node still reaches the scroll view behind it. day-core withholds the cross-axis drags from the handler.

Source§

fn primary_pointer(&self) -> PointerKind

A Mac’s pointer is a mouse or a trackpad until a pen says otherwise.

Source§

fn announce(&mut self, text: &str, urgent: bool)

The announcement request goes out from the primary window (any live element will do; the app object stands in before the window exists). Without VoiceOver nothing observes the notification, so posting is free.

Source§

fn decode_image(&mut self, req: u64, id: BitmapId, bytes: &[u8])

Decode bytes into an NSImage (docs/images.md).

NSBitmapImageRep is asked first and kept: it is what actually reads the container, it answers in PIXELS (NSImage.size is in points and reports a 144-DPI photo at two-thirds its real width), and it is the only thing here that can re-encode later.

Source§

fn image_properties(&mut self, id: BitmapId) -> Option<ImageProperties>

The container’s own metadata (docs/images.md).

DPI is DERIVED rather than read from a tag: AppKit has already resolved the file’s resolution into the rep’s point size, so pixels-per-point × 72 is the number the platform itself believes — and it is right for containers that record resolution in ways EXIF does not.

Source§

fn encode_formats(&mut self) -> Vec<ImageFormat>

What NSBitmapImageRep WRITES. It reads more than this — WebP and HEIF among them — and the asymmetry is the platform’s own, which is exactly why this duty exists instead of letting Cap::ImageEncode imply every format round-trips.

Source§

fn render_bitmap( &mut self, req: u64, id: BitmapId, ops: &[DrawOp], size: Size, scale: f64, )

Replay ops offscreen through the canvas’s own painter (docs/canvas.md “Exporting”) and keep the result in the decode table, so image, encode_image and DrawOp::Image take it like any decoded bitmap.

The paint runs on a day_spec::offscreen thread: CoreGraphics draws into a bitmap context from any thread, so a long replay (a map tile of a thousand paths) no longer holds a frame. The images and fonts the ops need are resolved here first, the painted CGImage comes back on the main queue, and the table insert and the answer happen there, in that order.

Source§

fn font_families(&mut self) -> Vec<FontFamilyInfo>

NSFontManager.availableFontFamilies + availableMembersOfFontFamily:, whose members are [postscriptName, styleName, weight 0 … 15, traits] (docs/fonts.md). The .-prefixed families are the system’s private UI faces and are skipped, as Font Book skips them.

Source§

fn measure_text( &mut self, text: &str, size: f64, font: &CanvasFont, ) -> Option<TextMetrics>

sizeWithAttributes: with the attributes replay draws with; the ascent is the font’s own, so at.y + ascent is where the glyphs’ baseline lands.

Source§

fn set_launcher_shortcuts(&mut self, _shortcuts: &[LauncherShortcut])

The Dock menu lists them: day-core folds the run-time shortcuts into the model it sends through set_dock_menu, so there is nothing more to install here.

Source§

type Handle = Retained<NSView>

Source§

fn dark_mode(&mut self) -> bool

Source§

fn set_appearance(&mut self, dark: Option<bool>)

App-level appearance override: Some(true) forces dark, Some(false) forces light, None returns to following the system. Backends restyle their native widgets in place and answer the override from dark_mode; app-painted surfaces pick it up on their next rebuild. Cap::Appearance reports whether the backend honors this; the default ignores the call.
Source§

fn attach_refresh(&mut self, handle: &Self::Handle, host: NodeId)

Attach overscroll delivery to a refresh host; the caller owns the mounted scope.
Source§

fn set_presented(&mut self, handle: &Self::Handle, visible: bool)

Show or hide a retained subtree, including its input and accessibility participation. The layout and reactive scope stay alive while hidden.
Source§

fn capability(&self, cap: Cap) -> Support

Source§

fn realize(&mut self, kind: PieceKind, props: &dyn Any, id: NodeId) -> Handle

Source§

fn update( &mut self, h: &Handle, kind: PieceKind, patch: &dyn Any, anim: Option<&AnimSpec>, )

Source§

fn release(&mut self, h: Handle)

Called from the turn-boundary release queue; backends may defer destruction further.
Source§

fn insert(&mut self, parent: &Handle, child: &Handle, _index: usize)

Source§

fn remove(&mut self, parent: &Handle, child: &Handle)

Source§

fn move_child(&mut self, parent: &Handle, child: &Handle, _to: usize)

Put child at index to among parent’s native children: day’s z-order resync, which walks the whole sibling row and asks for every position in turn. A child already at to must therefore cost nothing: a backend that re-parents unconditionally pays for the untouched siblings too, and where re-parenting means detach-then-add (no ViewGroup move primitive on Android) the detach resigns the focus of everything inside the subtree, which is how a text field being typed into loses the keyboard (docs/focus.md).
Source§

fn measure(&mut self, h: &Handle, kind: PieceKind, p: Proposal) -> Size

Source§

fn set_transform( &mut self, h: &Handle, t: Transform, _size: Size, anim: Option<&AnimSpec>, )

Source§

fn set_selectable(&mut self, h: &Handle, selectable: bool) -> Option<Handle>

Source§

fn set_input_traits( &mut self, h: &Handle, traits: &InputTraits, ) -> Option<Handle>

Source§

fn set_cursor(&mut self, h: &Handle, cursor: Cursor)

Source§

fn set_frame(&mut self, h: &Handle, frame: Rect, anim: Option<&AnimSpec>)

Source§

fn set_scroll_content(&mut self, h: &Handle, content: Size)

Source§

fn scroll_offset(&mut self, h: &Handle) -> Point

Source§

fn focus(&mut self, h: &Handle, _node: NodeId, focused: bool)

Source§

fn set_focusable(&mut self, h: &Handle, node: NodeId, focusable: bool)

Source§

fn set_event_sink(&mut self, sink: EventSink)

Source§

fn set_edit_state(&mut self, state: &EditState)

Source§

fn modifiers(&mut self) -> Modifiers

Source§

fn set_undo_state(&mut self, state: &UndoState)

Source§

fn attach_list(&mut self, host: &Handle, source: ListSource)

Source§

fn attach_tree(&mut self, host: &Handle, source: TreeSource)

Source§

fn adopt(&mut self, raw: RawHandle) -> Handle

Source§

fn edit_toolbar(&mut self, h: &Handle, ops: &[ToolbarOp]) -> bool

Edit the window’s toolbar (docs/toolbars.md): the ToolbarOps, removals first, then insertions in ascending position. The bar starts empty, and becomes empty again when every item has been removed, at which point the backend takes it off the window. Read more
Source§

fn update_toolbar(&mut self, h: &Handle, patch: &ToolbarPatch)

Apply a targeted change to one live toolbar item, the path a bound signal writes through, so syncing a search field does not rebuild the bar. No-op if the item is not present.
Source§

fn set_app_menu(&mut self, items: &[MenuItem])

The application menu (macOS/Windows/Linux menu bar; the app-bar overflow on Android; the UIMenuBuilder main menu on iPadOS/Catalyst). Replaces any previous app menu.
Source§

fn set_context_menu(&mut self, h: &Handle, _node: NodeId, items: &[MenuItem])

A context menu for h, shown on secondary-click (desktop) or long-press (mobile). Passing an empty slice removes it.
Source§

fn set_drag_source(&mut self, h: &Handle, source: Source)

Source§

fn set_drop_target(&mut self, h: &Handle, target: Target)

Source§

fn set_context_menu_fn(&mut self, h: &Handle, _node: NodeId, f: ContextMenuFn)

Source§

fn set_button_menu(&mut self, h: &Handle, _node: NodeId, f: ContextMenuFn)

Make the button h (a kinds::BUTTON node) a pull-down menu button (docs/menus.md “Menu buttons”): its primary press (a click, a tap, the keyboard’s Space or Return, the accessibility press) asks f for the menu at that moment and shows it under the button with the toolkit’s own menu, instead of reporting Event::Pressed. f is called on the UI thread, outside any day-core borrow, with Point::ZERO (where on the button the press landed does not change its menu); an empty result shows nothing. Chosen items fire Event::MenuAction as a context menu’s do. Read more
Source§

fn enable_gesture(&mut self, h: &Handle, node: NodeId, kind: GestureKind)

Source§

fn set_hit_slop(&mut self, h: &Handle, _node: NodeId, slop: Insets)

Source§

fn set_subtree_enabled(&mut self, h: &Handle, _node: NodeId, enabled: bool)

Source§

fn set_a11y(&mut self, h: &Handle, a11y: &A11yProps)

Apply a node’s accessibility annotations (docs/accessibility.md): the label, hint and value the screen reader speaks, an explicit role, whether the node is hidden from assistive technology, and the automation identifier. Called with the node’s whole accumulated set each time any of it changes, so every member is written on every call. Only an explicit role is applied: a native control reports its own.
Source§

fn read_native(&self, h: &Handle) -> NativeSnapshot

Read a widget’s native state back from the platform for a11y_audit and assert_native (§14.2, docs/testing.md) to diff against Day’s expectation. Default: nothing read; the audit skips the node and assert_native records each field as unread.
Source§

fn request_frame(&mut self, host: &Handle, cb: FrameCallback) -> CancelFrame

Request one frame for the window containing host. Never call inline. Each native source must stop after delivery unless requested again; no polling timer. Hidden/unmapped windows may defer delivery until visible. Native callbacks must reach the UI thread before calling Rust. The returned closure cancels safely, including when the window has closed. The mock intentionally stays pending: tests inject a manual scheduler in day-core.
Source§

fn replay(&mut self, h: &Handle, ops: &[DrawOp], _size: Size)

Source§

fn toggle_sidebar(&mut self, host: &Self::Handle) -> bool

Show/hide the sidebar pane of the navigation host host, which is what the sidebar affordance a nav(Sidebar) contributes for itself drives (SIDEBAR_TOGGLE_ID). false when host has no pane to toggle (a stack, a tab bar, no sidebar concept at all). Read more
Source§

fn snapshot_window(&mut self) -> Result<Vec<u8>, String>

Capture the primary window’s content as encoded image bytes (the dayscript screenshot step, docs/window-image.md). Read more
Source§

fn image_info(&mut self, id: BitmapId) -> Option<BitmapInfo>

What a decoded image is: pixel size, scale, format, alpha (BitmapInfo). Read more
Source§

fn encode_image(&mut self, req: u64, id: BitmapId, spec: &EncodeSpec)

Encode a decoded image back to bytes per spec, answering req with Event::ImageEncoded. A format outside Self::encode_formats answers ImageError::Encode rather than silently substituting another one. Read more
Source§

fn release_image(&mut self, id: BitmapId)

Drop a decoded image and everything the backend cached for it. Called when the app’s last handle to it goes away; an id the backend never saw is a no-op.
Source§

fn render_pdf(&mut self, req: u64, pages: &[PdfPage], info: &PdfInfo)

Replay each page into one PDF document and answer req with Event::PdfRendered. Units are PDF points, top-left origin; shapes and text stay vector, and images embed at their pixel size. pages is never empty. Defaulted to nothing: day-core probes Cap::CanvasPdf first.
Source§

fn snapshot_window_chrome(&mut self) -> Result<Vec<u8>, String>

The same capture with the window’s own chrome: title bar, toolbar, whatever the platform draws around the content (docs/window-image.md). Read more
Source§

fn snapshot_window_of(&mut self, host: &Handle) -> Result<Vec<u8>, String>

Snapshot the window whose content container is host (the dayscript screenshot step’s window: target). The default answers the primary snapshot, so backends that never open windows stay correct without changes. Read more
Source§

fn open_window( &mut self, id: NodeId, options: &WindowOptions, kind: WindowKind, ) -> WindowOpenReply<Handle>

Open a native OS window per options + kind: create and show the window, wire its events to id (WindowResized with the content size in points, WindowClosed after the native close, WindowFocused on key/active changes), and answer with its content container handle, the same contract as the ready root container. Backends whose window creation is asynchronous (a scene, an activity, an ability) answer WindowOpenReply::Pending and complete later through day_core::finish_window_open(id, raw, size), which goes through Toolkit::adopt. The default answers Unsupported; day-core then presents the content as a fullscreen cover in the primary window instead.
Source§

fn native_window_tabs(&self) -> bool

True OS window groups, as distinct from native tab widgets.
Source§

fn group_windows(&mut self, hosts: &[Handle])

Join/reorder these windows in an OS tab group. Content remains window-owned.
Source§

fn window_tab_order(&self, host: &Handle) -> Vec<NodeId>

Current native order of the group containing this window, including detached groups.
Source§

fn close_window(&mut self, host: &Handle)

Close the native window whose content container is host (a handle open_window produced). Asynchronous: the platform confirms with Event::WindowClosed on the window’s root node, and only then does day-core tear the subtree down. Idempotent; unknown hosts are ignored. Never called with the primary window’s container.
Source§

fn focus_window(&mut self, host: &Handle)

Bring the window whose content container is host to front and make it key/active: the focus half of open-or-focus singleton windows. Default no-op.
Source§

fn fit_window(&mut self, host: &Handle, size: Size)

Resize the window whose content container is host to fit size of content, and pin it there: what WindowOptions::size_to_fit asks for (docs/windows.md). Read more
Source§

fn set_window_title(&mut self, host: &Handle, title: &str)

Retitle the window whose content container is host. Default no-op.
Source§

fn apply_window(&mut self, host: &Handle, change: &WindowChange)

Apply one property change to the window whose content container is host (docs/windows.md “Window properties”). The primary window arrives with its root container, like set_window_title. Read more
Source§

fn window_frame(&self, host: &Handle) -> Option<Rect>

The outer frame of the window whose content container is host, in points on the desktop’s coordinate space (top-left origin), or None where the platform does not say (a phone, Wayland’s positions). Read when the app asks for it and when day-core saves a remembered frame (WindowOptions::remember_frame).
Source§

fn monitors(&self) -> Vec<Monitor>

The displays attached now (docs/windows.md “Monitors”). Cap::Monitors; the default answers none, and day-core then describes the primary window’s own size as one display.
Source§

fn set_dock_menu(&mut self, items: &[MenuItem])

Install the app’s Dock menu (docs/menus.md “Dock menu”): the items macOS shows above its own when the user right-clicks the app’s Dock icon, built from the app’s [[shortcuts]] and its dock_menu(..) entries. Same item model and dispatch as set_app_menu; an empty slice removes the menu. Cap::DockMenu reports support; the default ignores the call.
Source§

fn set_drag_region(&mut self, h: &Handle, drag: bool)

Make the node at h move its window when the user drags it, as a title bar does (.window_drag_region(), docs/window-chrome.md): the region’s own background starts a native window drag (with the platform’s snapping and edge tiling), a double click does what the user’s title-bar double-click setting says, and controls inside the region keep receiving their own clicks. false releases it. Cap::DragRegion; the default ignores the call, so on a phone the region is an ordinary view.
Source§

fn set_status_items(&mut self, items: &[StatusItemSpec])

Show these status items, replacing the previous set (docs/status-item.md): add the ones whose id is new, update the ones that changed, remove the ones no longer listed. A click on an item runs its activate action or opens its menu; menu choices dispatch Event::MenuAction like the app menu’s. Cap::StatusItem; the default ignores the call, which is what a phone and the web do.
Source§

fn set_app_progress(&mut self, progress: AppProgress)

Show progress on the app’s Dock or taskbar icon (docs/status-item.md). Cap::AppProgress; the default ignores it.
Source§

fn set_dock_visible(&mut self, visible: bool)

Show or hide the app’s Dock icon while it runs: a menu-bar app hides it and lives in its status item (macOS activation policy). Cap::DockVisibility; the default ignores it.
Source§

fn set_keep_running(&mut self, keep: bool)

Keep the process running when its last window closes (docs/windows.md “Keeping the app running”). When true, the backend must not end the app on its own as windows close: it reports every close, the first window’s included, as Event::WindowClosed, and day-core decides whether to call quit_app. When false, the backend keeps its platform’s own rule. A backend whose process lifetime is not its own (a phone, a browser tab) ignores it, which is the default.
Source§

fn quit_app(&mut self)

End the application: the last window with WindowRole::Primary has closed (docs/windows.md). day-core decides when, since it owns the window registry and the role each window carries; the backend supplies only the platform’s exit: NSApplication.terminate, QCoreApplication::quit, GtkApplication.quit, PostQuitMessage. Everything day-core wanted to happen first (secondary windows disposed, WillTerminate delivered) already has by the time this is called. Read more
Source§

fn present(&mut self, req: u64, spec: &PresentSpec)

Source§

fn dismiss(&mut self, req: u64)

Source§

fn application_handlers( &mut self, query: &HandlerQuery, ) -> Result<ApplicationHandlers, ApplicationError>

Read current OS associations. Unsupported platforms must not fabricate a default. Read more
Source§

fn open_url_with_application( &mut self, url: &str, application: &str, completion: OpenApplicationCompletion, )

Open with an opaque application identifier returned by application_handlers.
Source§

fn share_support(&self) -> Support

Whether a native share chooser is available. Does not probe installed share targets.
Source§

fn share(&mut self, spec: &ShareSpec, anchor: Option<&Self::Handle>) -> bool

Present the system share chooser for spec (docs/sharing.md). True means presentation started, not that sharing completed. Never sends data without the user’s choice of a target. Where the chooser can carry the app’s own actions (Cap::ShareActions), each of spec.actions appears with its title and glyph, and choosing one enqueues Event::MenuAction(action.id); elsewhere the actions are left out. anchor is the control the chooser points at where it is a popover (iPad, macOS); without one the chooser uses the window’s top trailing corner.
Source§

fn open_url(&mut self, url: &str)

Open url in the platform’s default handler: the system browser for http(s), the mail client for mailto:, etc. Backs the link piece. Fire and forget: there is no result, and an unopenable URL is ignored. The default no-ops so a backend that hasn’t wired it up still compiles.
Source§

fn scroll_bar_inset(&mut self, _h: &Self::Handle, _vertical: bool) -> f64

Source§

fn nav_scroll_to_edge(&mut self, _h: &Self::Handle, _bottom: bool) -> bool

Scroll a native navigation menu to its top or bottom without changing selection. The widget owns its content extent. Return false when the handle is unsupported.
Source§

fn set_route(&mut self, _route: &str)

Source§

fn supports_lifecycle(&self, phase: Lifecycle) -> bool

Source§

fn snapshot_origin(&mut self, _root: &Self::Handle) -> Option<Point>

Where root, the primary window’s root container, sits in Self::snapshot_window’s image, in points from its top-left. A reader of the capture (dayscript sample_pixel) maps Day’s frames into it with this; it matters where the capture spans more than Day’s content on more than one side, as Android’s edge-to-edge content does (status bar above, navigation bar below). Read more
Source§

fn prepare_snapshot( &mut self, _host: Option<&Self::Handle>, _revision: u32, ) -> Result<Readiness, String>

Establish a fresh screenshot checkpoint after reactive work and native transitions. revision is stable across retries and unique to the request; host selects a secondary window, or None for the primary. Never block the UI thread waiting for a frame. Pending requests are retried within the dayscript deadline. Read more
Source§

fn native_back(&mut self) -> bool

Press the platform’s own back affordance (the navigation bar’s back button on iOS, the system back on Android) on the innermost navigation host that has something to pop. What nav_back() does not do: that is Day’s rail, which pops the model and lets the backend follow, while this runs the native path first (the bar’s shouldPop, the dispatcher’s callbacks, the pop itself) and lets the backend report it to Day as a user back, guard and all. dayscript’s nav_back: { native: true } drives it, so a walkthrough can cover the code that a real tap runs and Day’s rail never reaches. false when this toolkit has no native back or nothing is popped by it. Defaulted, so a desktop needs no code. docs/navigation.md.
Source§

fn set_system_back(&mut self, _armed: bool)

Take (true) or release (false) the platform’s system back for the app’s own handlers (Decorate::on_system_back): day-core arms it while at least one mounted handler is enabled. Armed, a system back that nothing native consumes first (a presented cover, a pushed page, an armed guard) reaches Day as Event::NavBack on WINDOW_NODE instead of leaving the app; released, the platform’s default runs, predictive-back preview and all. Android registers an OnBackPressedCallback beneath its own; HarmonyOS consumes the page’s onBackPress. Defaulted, so a toolkit with no system back (desktop, iOS, the web) needs no code. docs/navigation.md “Handling the system Back”.
Source§

fn defer_system_gestures(&mut self, _edges: Edges)

Ask the OS to require a second swipe for its edge gestures on edges (docs/cover.md): the union requested by every mounted defers_system_gestures modifier, re-sent whenever that set changes (Edges::NONE when the last one unmounts). iOS defers the home indicator / notification edges; Android enters swipe-to-reveal immersive mode while non-empty. The default no-ops (desktop has no system edge gestures).
Source§

fn set_status_bar_hidden(&mut self, _hidden: bool)

Hide (true) or show the system status bar (docs/cover.md): whether any mounted status_bar_hidden modifier currently asks for it hidden, re-sent whenever that answer may have changed (false when the last request unmounts). iOS answers the root and cover view controllers’ prefersStatusBarHidden; Android and HarmonyOS hide the status bar through their window inset controls. The default no-ops (desktop and web have no status bar); report Cap::StatusBarHidden alongside an implementation.
Source§

fn on_suspend(&mut self)

Source§

fn on_resume(&mut self)

Source§

fn on_memory_warning(&mut self)

Source§

fn native_document_tabs(&self) -> bool

Native in-window document/section tab control; OS grouping is reported separately.

Auto Trait Implementations§

§

impl !RefUnwindSafe for AppKit

§

impl !Send for AppKit

§

impl !Sync for AppKit

§

impl !UnwindSafe for AppKit

§

impl Forget for AppKit

§

impl Freeze for AppKit

§

impl Move for AppKit

§

impl Unpin for AppKit

§

impl UnsafeUnpin for AppKit

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AutoreleaseSafe for T
where T: ?Sized,

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.