Struct floem::context::AppState

source ·
pub struct AppState {
    pub taffy: Taffy,
    /* private fields */
}
Expand description

Encapsulates and owns the global state of the application, including the ViewState of each view.

Fields§

§taffy: Taffy

Implementations§

source§

impl AppState

source

pub fn new() -> Self

source

pub fn view_state(&mut self, id: Id) -> &mut ViewState

source

pub fn remove_view(&mut self, view: &mut dyn View)

This removes a view from the app state.

source

pub fn is_hidden(&self, id: Id) -> bool

source

pub fn is_hidden_recursive(&self, id: Id) -> bool

Is this view, or any parent view, marked as hidden

source

pub fn is_hovered(&self, id: &Id) -> bool

source

pub fn is_disabled(&self, id: &Id) -> bool

source

pub fn is_focused(&self, id: &Id) -> bool

source

pub fn is_active(&self, id: &Id) -> bool

source

pub fn is_clicking(&self, id: &Id) -> bool

source

pub fn is_dragging(&self) -> bool

source

pub fn set_root_size(&mut self, size: Size)

source

pub fn get_builtin_style(&mut self, id: Id) -> BuiltinStyle<'_>

source

pub fn compute_layout(&mut self)

source

pub fn request_style_recursive(&mut self, id: Id)

Requests style for a view and all direct and indirect children.

source

pub fn request_all(&mut self, id: Id)

Request that this the id view be styled, laid out and painted again. This will recursively request this for all parents.

source

pub fn schedule_style(&mut self, id: Id)

Requests that the style pass will run for id on the next frame, and ensures new frame is scheduled to happen.

source

pub fn schedule_layout(&mut self, id: Id)

Requests that the layout pass will run for id on the next frame, and ensures new frame is scheduled to happen.

source

pub fn schedule_paint(&mut self, id: Id)

Requests that the paint pass will run for id on the next frame, and ensures new frame is scheduled to happen.

source

pub fn request_style(&mut self, id: Id)

source

pub fn request_layout(&mut self, id: Id)

source

pub fn request_compute_layout_recursive(&mut self, _id: Id)

Requests that compute_layout will run for _id and all direct and indirect children.

source

pub fn request_paint(&mut self, _id: Id)

source

pub fn get_content_rect(&mut self, id: Id) -> Rect

Returns the layout rect excluding borders, padding and position. This is relative to the view.

Trait Implementations§

source§

impl Default for AppState

source§

fn default() -> Self

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

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

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

§

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

§

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more