Struct carbide_core::UiCell[][src]

pub struct UiCell<'a, S: GlobalState> { /* fields omitted */ }

A wrapper around the Ui that restricts the user from mutating the Ui in certain ways while in the scope of the Ui::set_widgets function and within Widgets' update methods. Using the UiCell, users may access the Ui immutably (via Deref) however they wish, however they may only mutate the Ui via the &mut self methods provided by the UiCell.

The name came from its likening to a "jail cell for the Ui", as it restricts a user's access to it. However, we realise that the name may also cause ambiguity with the std Cell and RefCell render (which UiCell has nothing to do with). Thus, if you have a better name for this type in mind, please let us know at the github repo via an issue or PR sometime before we hit 1.0.0!

Implementations

impl<'a, S: GlobalState> UiCell<'a, S>[src]

pub fn font(&self, id: Id) -> Option<&Font>[src]

A convenience method for borrowing the Font for the given Id if it exists.

pub fn window_dim(&self) -> Dimensions[src]

Returns the dimensions of the window

pub fn set_mouse_cursor(&mut self, cursor: MouseCursor)[src]

Sets the mouse cursor

Methods from Deref<Target = Ui<S>>

pub fn mouse_cursor(&self) -> MouseCursor[src]

Get mouse cursor state.

Trait Implementations

impl<'a, S: GlobalState> AsRef<Ui<S>> for UiCell<'a, S>[src]

impl<'a, S: Debug + GlobalState> Debug for UiCell<'a, S>[src]

impl<'a, S: GlobalState> Deref for UiCell<'a, S>[src]

type Target = Ui<S>

The resulting type after dereferencing.

Auto Trait Implementations

impl<'a, S> !RefUnwindSafe for UiCell<'a, S>[src]

impl<'a, S> !Send for UiCell<'a, S>[src]

impl<'a, S> !Sync for UiCell<'a, S>[src]

impl<'a, S> Unpin for UiCell<'a, S>[src]

impl<'a, S> !UnwindSafe for UiCell<'a, S>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

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