Struct carbide_core::UiCell [−][src]
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 Widget
s' 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]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,