Skip to main content

HostOffer

Struct HostOffer 

Source
pub struct HostOffer {
Show 24 fields pub id: String, pub code: String, pub name: String, pub source: String, pub size: HostSize, pub resizable: bool, pub focus: FocusPolicy, pub owns_keys: Vec<ClaimKey>, pub honours_claims: bool, pub dismissed_by: Vec<Dismiss>, pub lifetime: Lifetime, pub window: Window, pub keymap: bool, pub projection: bool, pub keeps: Vec<Keep>, pub gives_ui: bool, pub gives_app: bool, pub scope: bool, pub fault_boundary: bool, pub display: HostDisplay, pub cursor_images: bool, pub free_content: bool, pub hides_content: bool, pub headless: bool,
}
Expand description

What a host offers what is mounted in it.

Fields§

§id: String

A stable id (panel, dialog.custom).

§code: String

Its column in docs/hosts.md (P, F…).

§name: String

As people call it.

§source: String

Where it is in the code.

§size: HostSize§resizable: bool

The user can resize it.

§focus: FocusPolicy§owns_keys: Vec<ClaimKey>

Keys the host takes before the content (a modal’s Enter and Escape).

§honours_claims: bool

A content claiming a key the host owns gets it (a custom dialog: Ctrl+Enter accepts when the content claims Enter).

§dismissed_by: Vec<Dismiss>§lifetime: Lifetime§window: Window§keymap: bool

The key dispatcher reaches it.

§projection: bool

Part of the context stack’s projection (ADR 0012).

§keeps: Vec<Keep>§gives_ui: bool

Gives its content a Ui.

§gives_app: bool

Gives its content the application (an AppHandle).

§scope: bool

Draws its content in a focus scope of its own.

§fault_boundary: bool

Draws its content inside a fault boundary.

§display: HostDisplay§cursor_images: bool

Bitmap cursors are shown in it.

§free_content: bool

Takes any content (not only value-descriptor fields).

§hides_content: bool

Its content may stop being drawn while it lives (a tab behind another, a rolled-up palette).

§headless: bool

It can be mounted in a headless test (kittest).

Implementations§

Source§

impl HostOffer

Source

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

A host filling a rect in the main window, shared focus, persistent, with the keymap, a Ui, the application, a scope and a fault boundary, sRGB, any content, testable headless.

Source

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

Where it is in the code.

Source

pub fn size(self, size: HostSize) -> Self

Source

pub fn resizable(self, on: bool) -> Self

Source

pub fn focus(self, focus: FocusPolicy) -> Self

Source

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

Keys taken before the content.

Source

pub fn honours_claims(self) -> Self

A content claiming a key the host owns gets it.

Source

pub fn dismissed_by(self, by: &[Dismiss]) -> Self

Source

pub fn lifetime(self, lifetime: Lifetime) -> Self

Source

pub fn window(self, window: Window) -> Self

Source

pub fn keymap(self, on: bool) -> Self

Source

pub fn projection(self, on: bool) -> Self

Source

pub fn keeps(self, keeps: &[Keep]) -> Self

Source

pub fn gives_ui(self, on: bool) -> Self

Source

pub fn gives_app(self, on: bool) -> Self

Source

pub fn scope(self, on: bool) -> Self

Source

pub fn fault_boundary(self, on: bool) -> Self

Source

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

Source

pub fn cursor_images(self, on: bool) -> Self

Source

pub fn free_content(self, on: bool) -> Self

Source

pub fn hides_content(self, on: bool) -> Self

Source

pub fn headless(self, on: bool) -> Self

Source

pub fn is_modal(&self) -> bool

Whether it is modal.

Trait Implementations§

Source§

impl Clone for HostOffer

Source§

fn clone(&self) -> HostOffer

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 HostOffer

Source§

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

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

impl Default for HostOffer

Source§

fn default() -> HostOffer

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

impl PartialEq for HostOffer

Source§

fn eq(&self, other: &HostOffer) -> 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 HostOffer

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 HostOffer

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.