ClayLayoutScope

Struct ClayLayoutScope 

Source
pub struct ClayLayoutScope<'clay, 'render, ImageElementData, CustomElementData> { /* private fields */ }

Implementations§

Source§

impl<'render, 'clay: 'render, ImageElementData: 'render, CustomElementData: 'render> ClayLayoutScope<'clay, 'render, ImageElementData, CustomElementData>

Source

pub fn with<F: FnOnce(&mut ClayLayoutScope<'clay, 'render, ImageElementData, CustomElementData>)>( &mut self, declaration: &Declaration<'render, ImageElementData, CustomElementData>, f: F, )

Create an element, passing its config and a function to add childrens

Source

pub fn with_styling<G: FnOnce(&ClayLayoutScope<'clay, 'render, ImageElementData, CustomElementData>) -> Declaration<'render, ImageElementData, CustomElementData>, F: FnOnce(&ClayLayoutScope<'clay, 'render, ImageElementData, CustomElementData>)>( &self, g: G, f: F, )

Source

pub fn end( &mut self, ) -> impl Iterator<Item = RenderCommand<'render, ImageElementData, CustomElementData>>

Source

pub fn id(&self, label: &'render str) -> Id

Generates a unique ID based on the given label.

This ID is global and must be unique across the entire scope.

Source

pub fn id_index(&self, label: &'render str, index: u32) -> Id

Generates a unique indexed ID based on the given label and index.

This is useful when multiple elements share the same label but need distinct IDs.

Source

pub fn id_local(&self, label: &'render str) -> Id

Generates a locally unique ID based on the given label.

The ID is unique within a specific local scope but not globally.

Source

pub fn id_index_local(&self, label: &'render str, index: u32) -> Id

Generates a locally unique indexed ID based on the given label and index.

This is useful for differentiating elements within a local scope while keeping their labels consistent.

Source

pub fn text(&self, text: &'render str, config: TextElementConfig)

Adds a text element to the current open element or to the root layout

Source

pub fn hovered(&self) -> bool

Source

pub fn pointer_over(&self, cfg: Id) -> bool

Source

pub fn scroll_container_data(&self, id: Id) -> Option<Clay_ScrollContainerData>

Source

pub fn bounding_box(&self, id: Id) -> Option<BoundingBox>

Source

pub fn scroll_offset(&self) -> Vector2

Trait Implementations§

Source§

impl<ImageElementData, CustomElementData> Drop for ClayLayoutScope<'_, '_, ImageElementData, CustomElementData>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'clay, 'render, ImageElementData, CustomElementData> Freeze for ClayLayoutScope<'clay, 'render, ImageElementData, CustomElementData>

§

impl<'clay, 'render, ImageElementData, CustomElementData> RefUnwindSafe for ClayLayoutScope<'clay, 'render, ImageElementData, CustomElementData>
where ImageElementData: RefUnwindSafe, CustomElementData: RefUnwindSafe,

§

impl<'clay, 'render, ImageElementData, CustomElementData> !Send for ClayLayoutScope<'clay, 'render, ImageElementData, CustomElementData>

§

impl<'clay, 'render, ImageElementData, CustomElementData> !Sync for ClayLayoutScope<'clay, 'render, ImageElementData, CustomElementData>

§

impl<'clay, 'render, ImageElementData, CustomElementData> Unpin for ClayLayoutScope<'clay, 'render, ImageElementData, CustomElementData>

§

impl<'clay, 'render, ImageElementData, CustomElementData> !UnwindSafe for ClayLayoutScope<'clay, 'render, ImageElementData, CustomElementData>

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