Skip to main content

BuildScope

Struct BuildScope 

Source
pub struct BuildScope { /* private fields */ }
Expand description

A class that determines the scope of a BuildOwner::build_scope operation.

The BuildOwner::build_scope method rebuilds all dirty Elements who share the same BuildScope with its context argument, and skips those with a different Element::build_scope.

Elements by default have the same BuildScope as their parents. Special Elements may override Element::build_scope to create an isolated build scope for its descendants. The LayoutBuilder widget, for example, establishes its own BuildScope such that no descendant Elements may rebuild prematurely until the incoming constraints are known.

Implementations§

Source§

impl BuildScope

Source

pub fn new(app: &mut App, schedule_rebuild: Option<Listener>) -> Ref<BuildScope>

Creates a BuildScope with an optional schedule_rebuild callback.

Source

pub fn dirty_elements(self: Handle<Self>, app: &App) -> &[AnyElement]

The elements marked dirty in this scope, in scheduling order.

Auto Trait Implementations§

§

impl !RefUnwindSafe for BuildScope

§

impl !Send for BuildScope

§

impl !Sync for BuildScope

§

impl !UnwindSafe for BuildScope

§

impl Forget for BuildScope

§

impl Freeze for BuildScope
where *const RcInner<dyn Fn(&mut App)> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App)>>: Freeze, NonZero<u32>: Freeze, *const (): Freeze, *const u8 is !null: Freeze, PhantomData<AnyElement>: Freeze,

§

impl Move for BuildScope

§

impl Unpin for BuildScope
where Rc<dyn Fn(&mut App)>: Unpin, NonZero<u32>: Unpin, *const (): Unpin, *const u8 is !null: Unpin, &'static ElementVTable: Unpin,

§

impl UnsafeUnpin for BuildScope
where *const RcInner<dyn Fn(&mut App)> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App)>>: UnsafeUnpin, NonZeroU32Inner: UnsafeUnpin, *const (): UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<AnyElement>: UnsafeUnpin,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>