pub struct Mountable {Show 21 fields
pub id: String,
pub name: String,
pub from: String,
pub keyboard: Keyboard,
pub claims: Vec<ClaimKey>,
pub keymap: bool,
pub surface: Option<String>,
pub pointer: Pointer,
pub workers: Workers,
pub keep_under_modal: bool,
pub display: Display,
pub size: SizeNeed,
pub instances: Instances,
pub view_state: Option<String>,
pub app: bool,
pub role: String,
pub asks: bool,
pub session: bool,
pub popups: bool,
pub preview: bool,
pub descriptor_field: bool,
}Expand description
What a component needs from the place it is mounted in.
Fields§
§id: StringA stable id (viewport, views.tree).
name: StringAs people call it.
from: StringThe crate it comes from.
keyboard: Keyboard§claims: Vec<ClaimKey>Keys it uses that a host may own (Enter, Escape…).
keymap: boolBindings of the keymap act on it (its surface’s or its commands’).
surface: Option<String>Its keymap surface, if it has one.
pointer: Pointer§workers: Workers§keep_under_modal: boolIts workers must keep delivering while another surface is modal (they do: workers are the application’s threads).
display: Display§size: SizeNeed§instances: Instances§view_state: Option<String>A key its view state (zoom, scroll, selection) is kept under by
the host; None: the caller keeps it.
app: boolIt needs the application (an AppHandle: services, steps).
role: StringIts accessibility role, as a word (image, tree, slider).
asks: boolIt is a question that must be answered before going on.
session: boolIt holds a session (unsaved text, a running program, a draft) that must not end by accident.
popups: boolIt opens egui areas of its own (popups, context menus, completion lists).
preview: boolIt can be drawn non-interactive (a preview, a thumbnail).
descriptor_field: boolIt can be drawn as a value-descriptor field of a form.
Implementations§
Source§impl Mountable
impl Mountable
Sourcepub fn new(id: &str, name: &str) -> Self
pub fn new(id: &str, name: &str) -> Self
A plain widget: the keyboard when focused, no claims, several instances, no workers, sRGB, any size.
Sourcepub fn crate_name(self, name: &str) -> Self
pub fn crate_name(self, name: &str) -> Self
The crate it comes from.
pub fn keyboard(self, keyboard: Keyboard) -> Self
pub fn drag(self) -> Self
pub fn drag_out(self) -> Self
pub fn wheel(self) -> Self
pub fn cursor_images(self) -> Self
Sourcepub fn bounded_workers(self) -> Self
pub fn bounded_workers(self) -> Self
Fed by workers, its queue bounded while it is not drawn (drained off-draw or capped): no host makes it grow.
Sourcepub fn keep_under_modal(self) -> Self
pub fn keep_under_modal(self) -> Self
Its workers must keep delivering under a modal.
pub fn display(self, display: Display) -> Self
pub fn preferred(self, width: f32, height: f32) -> Self
pub fn max(self, width: f32, height: f32) -> Self
Sourcepub fn view_state(self, key: &str) -> Self
pub fn view_state(self, key: &str) -> Self
Its view state is kept by the host under key.
pub fn role(self, role: &str) -> Self
Sourcepub fn descriptor_field(self) -> Self
pub fn descriptor_field(self) -> Self
Can be a form’s field.
Sourcepub fn claims_key(&self, key: ClaimKey) -> bool
pub fn claims_key(&self, key: ClaimKey) -> bool
Whether it claims a key.