Skip to main content

Mountable

Struct Mountable 

Source
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: String

A stable id (viewport, views.tree).

§name: String

As people call it.

§from: String

The crate it comes from.

§keyboard: Keyboard§claims: Vec<ClaimKey>

Keys it uses that a host may own (Enter, Escape…).

§keymap: bool

Bindings 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: bool

Its 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: bool

It needs the application (an AppHandle: services, steps).

§role: String

Its accessibility role, as a word (image, tree, slider).

§asks: bool

It is a question that must be answered before going on.

§session: bool

It holds a session (unsaved text, a running program, a draft) that must not end by accident.

§popups: bool

It opens egui areas of its own (popups, context menus, completion lists).

§preview: bool

It can be drawn non-interactive (a preview, a thumbnail).

§descriptor_field: bool

It can be drawn as a value-descriptor field of a form.

Implementations§

Source§

impl Mountable

Source

pub fn new(id: &str, name: &str) -> Self

A plain widget: the keyboard when focused, no claims, several instances, no workers, sRGB, any size.

Source

pub fn crate_name(self, name: &str) -> Self

The crate it comes from.

Source

pub fn keyboard(self, keyboard: Keyboard) -> Self

Source

pub fn claims(self, keys: &[ClaimKey]) -> Self

Keys it takes for itself.

Source

pub fn keymap(self) -> Self

Bindings of the keymap act on it.

Source

pub fn surface(self, name: &str) -> Self

Its keymap surface (bindings act on it).

Source

pub fn drag(self) -> Self

Source

pub fn drag_out(self) -> Self

Source

pub fn wheel(self) -> Self

Source

pub fn cursor_images(self) -> Self

Source

pub fn workers(self) -> Self

Fed by workers, drained when drawn.

Source

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.

Source

pub fn keep_under_modal(self) -> Self

Its workers must keep delivering under a modal.

Source

pub fn display(self, display: Display) -> Self

Source

pub fn min(self, width: f32, height: f32) -> Self

The smallest size, in points.

Source

pub fn preferred(self, width: f32, height: f32) -> Self

Source

pub fn max(self, width: f32, height: f32) -> Self

Source

pub fn fills(self) -> Self

Takes all the space it is given.

Source

pub fn aspect(self, ratio: f32) -> Self

Keeps a width over height ratio.

Source

pub fn single(self) -> Self

One state per application.

Source

pub fn view_state(self, key: &str) -> Self

Its view state is kept by the host under key.

Source

pub fn needs_app(self) -> Self

Needs the application.

Source

pub fn role(self, role: &str) -> Self

Source

pub fn asks(self) -> Self

A question to answer before going on.

Source

pub fn session(self) -> Self

Holds a session that must not end by accident.

Source

pub fn popups(self) -> Self

Opens egui areas of its own.

Source

pub fn preview(self) -> Self

Can be drawn non-interactive.

Source

pub fn descriptor_field(self) -> Self

Can be a form’s field.

Source

pub fn claims_key(&self, key: ClaimKey) -> bool

Whether it claims a key.

Trait Implementations§

Source§

impl Clone for Mountable

Source§

fn clone(&self) -> Mountable

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Mountable

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Mountable

Source§

fn default() -> Mountable

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

impl PartialEq for Mountable

Source§

fn eq(&self, other: &Mountable) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Mountable

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Mountable

Auto Trait Implementations§

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> 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.