Skip to main content

Ui

Struct Ui 

Source
pub struct Ui {
    pub theme: Theme,
    pub text_metrics: TextMetrics,
    pub viewport: Option<Rect>,
    pub high_contrast: bool,
    pub ripple_style: RippleStyle,
    pub motion_preference: MotionPreference,
    pub motion_scheme: MotionScheme,
    /* private fields */
}

Fields§

§theme: Theme§text_metrics: TextMetrics§viewport: Option<Rect>

Optional full render viewport, distinct from the padded content layout bounds.

§high_contrast: bool§ripple_style: RippleStyle§motion_preference: MotionPreference§motion_scheme: MotionScheme

Implementations§

Source§

impl Ui

Source

pub fn needs_redraw(&self) -> bool

Source

pub fn next_wakeup(&self) -> Option<f64>

Source

pub fn semantics(&self) -> &[SemanticNode]

Source

pub fn pause_animations(&mut self)

Source

pub fn has_escape_target(&self) -> bool

Source

pub fn focused(&self) -> Option<u64>

Source

pub fn adapter_focus(&mut self, id: Option<u64>)

Transfer focus from a host editing adapter to an enabled control from the last frame.

Source

pub fn accessibility_focus(&mut self, id: Option<u64>)

Transfer focus from a keyboard or assistive-technology control, retaining the visible keyboard focus treatment. Unknown or disabled IDs clear focus.

Source

pub fn cached_text_bytes(&self) -> usize

Source

pub fn retained_motion_properties(&self) -> usize

Source

pub fn frame( &mut self, input: Input, bounds: Rect, gap: f32, build: impl FnOnce(&mut Frame<'_>), ) -> Vec<DrawCommand>

Source

pub fn frame_into( &mut self, input: Input, bounds: Rect, gap: f32, commands: &mut Vec<DrawCommand>, build: impl FnOnce(&mut Frame<'_>), )

Trait Implementations§

Source§

impl Default for Ui

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Forget for Ui

§

impl Freeze for Ui

§

impl Move for Ui

§

impl RefUnwindSafe for Ui

§

impl Send for Ui

§

impl Sync for Ui

§

impl Unpin for Ui

§

impl UnsafeUnpin for Ui

§

impl UnwindSafe for Ui

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> 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, 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.