pub struct OverlayState { /* private fields */ }Expand description
The current state of an Overlay.
Used to insert OverlayEntrys into the overlay using the insert and
insert_all functions.
Implementations§
Source§impl OverlayState
impl OverlayState
Sourcepub fn insert(
self: Handle<OverlayState>,
app: &mut App,
entry: Retained<Handle<OverlayEntry>>,
below: Option<Handle<OverlayEntry>>,
above: Option<Handle<OverlayEntry>>,
)
pub fn insert( self: Handle<OverlayState>, app: &mut App, entry: Retained<Handle<OverlayEntry>>, below: Option<Handle<OverlayEntry>>, above: Option<Handle<OverlayEntry>>, )
Insert the given entry into the overlay.
If below is non-None, the entry is inserted just below below. If above is
non-None, the entry is inserted just above above. Otherwise, the entry is inserted
on top.
It is an error to specify both above and below.
Sourcepub fn insert_all(
self: Handle<OverlayState>,
app: &mut App,
entries: Vec<Retained<Handle<OverlayEntry>>>,
below: Option<Handle<OverlayEntry>>,
above: Option<Handle<OverlayEntry>>,
)
pub fn insert_all( self: Handle<OverlayState>, app: &mut App, entries: Vec<Retained<Handle<OverlayEntry>>>, below: Option<Handle<OverlayEntry>>, above: Option<Handle<OverlayEntry>>, )
Insert all the entries in the given iterable.
If below is non-None, the entries are inserted just below below. If above is
non-None, the entries are inserted just above above. Otherwise, the entries are
inserted on top.
It is an error to specify both above and below.
Sourcepub fn rearrange(
self: Handle<OverlayState>,
app: &mut App,
new_entries: Vec<Retained<Handle<OverlayEntry>>>,
below: Option<Handle<OverlayEntry>>,
above: Option<Handle<OverlayEntry>>,
)
pub fn rearrange( self: Handle<OverlayState>, app: &mut App, new_entries: Vec<Retained<Handle<OverlayEntry>>>, below: Option<Handle<OverlayEntry>>, above: Option<Handle<OverlayEntry>>, )
Remove all the entries listed in the given iterable, then reinsert them into the overlay in the given order.
Entries mentioned in new_entries but absent from the overlay are inserted as if with
insert_all.
Entries not mentioned in new_entries but present in the overlay are positioned as a
group in the resulting list relative to the entries that were moved, as specified by one
of below or above, which, if specified, must be one of the entries in new_entries:
If below is non-None, the group is positioned just below below. If above is
non-None, the group is positioned just above above. Otherwise, the group is left on
top, with all the rearranged entries below.
It is an error to specify both above and below.
Sourcepub fn debug_is_visible(
self: Handle<OverlayState>,
app: &App,
entry: Handle<OverlayEntry>,
) -> bool
pub fn debug_is_visible( self: Handle<OverlayState>, app: &App, entry: Handle<OverlayEntry>, ) -> bool
(DEBUG ONLY) Check whether a given entry is visible (i.e., not behind an opaque entry).
This is an O(N) algorithm, and should not be necessary except for debug asserts. To avoid people depending on it, this function is implemented only in debug mode, and always returns false in release mode.
Trait Implementations§
Source§impl State for OverlayState
impl State for OverlayState
Source§fn state_data(
self: Handle<OverlayState>,
app: &App,
) -> &StateData<<OverlayState as State>::Widget>
fn state_data( self: Handle<OverlayState>, app: &App, ) -> &StateData<<OverlayState as State>::Widget>
state
(state_accessors!).Source§fn state_data_mut(
self: Handle<OverlayState>,
app: &mut App,
) -> &mut StateData<<OverlayState as State>::Widget>
fn state_data_mut( self: Handle<OverlayState>, app: &mut App, ) -> &mut StateData<<OverlayState as State>::Widget>
state_data.Source§fn debug_fill_properties(
self: Handle<OverlayState>,
app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( self: Handle<OverlayState>, app: &App, properties: &mut DiagnosticPropertiesBuilder, )
debugFillProperties: the properties this state shows where its element’s dump
names it (state: ScrollableState#1a2b3(offset: 0.0)), after the lifecycle and mounting
properties State’s base adds, which the framework adds first.Source§fn init_state(self: Handle<OverlayState>, app: &mut App)
fn init_state(self: Handle<OverlayState>, app: &mut App)
Source§fn activate(self: Handle<OverlayState>, app: &mut App)
fn activate(self: Handle<OverlayState>, app: &mut App)
deactivate. Read moreSource§fn dispose(self: Handle<OverlayState>, app: &mut App)
fn dispose(self: Handle<OverlayState>, app: &mut App)
Source§fn build(
self: Handle<OverlayState>,
app: &mut App,
_context: AnyElement,
) -> Rc<dyn Widget>
fn build( self: Handle<OverlayState>, app: &mut App, _context: AnyElement, ) -> Rc<dyn Widget>
Source§fn widget(self: Handle<Self>, app: &App) -> &Self::Widget
fn widget(self: Handle<Self>, app: &App) -> &Self::Widget
Source§fn context(self: Handle<Self>, app: &App) -> AnyElement
fn context(self: Handle<Self>, app: &App) -> AnyElement
Source§fn did_update_widget(
self: Handle<Self>,
app: &mut App,
old_widget: &Self::Widget,
)
fn did_update_widget( self: Handle<Self>, app: &mut App, old_widget: &Self::Widget, )
Source§fn set_state(self: Handle<Self>, app: &mut App, f: impl FnOnce(&mut Self))
fn set_state(self: Handle<Self>, app: &mut App, f: impl FnOnce(&mut Self))
Source§impl TickerProviderObject for OverlayState
impl TickerProviderObject for OverlayState
Source§fn create_ticker(
self: Handle<OverlayState>,
app: &mut App,
on_tick: FrameCallback,
) -> Retained<Handle<Ticker>>
fn create_ticker( self: Handle<OverlayState>, app: &mut App, on_tick: FrameCallback, ) -> Retained<Handle<Ticker>>
Source§impl TickerProviderStateMixin for OverlayState
impl TickerProviderStateMixin for OverlayState
Source§fn ticker_provider_data(
self: Handle<OverlayState>,
app: &App,
) -> &TickerProviderStateMixinData
fn ticker_provider_data( self: Handle<OverlayState>, app: &App, ) -> &TickerProviderStateMixinData
Source§fn ticker_provider_data_mut(
self: Handle<OverlayState>,
app: &mut App,
) -> &mut TickerProviderStateMixinData
fn ticker_provider_data_mut( self: Handle<OverlayState>, app: &mut App, ) -> &mut TickerProviderStateMixinData
ticker_provider_data.Source§fn debug_fill_properties(
self: Handle<Self>,
app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( self: Handle<Self>, app: &App, properties: &mut DiagnosticPropertiesBuilder, )
TickerProviderStateMixin.debugFillProperties, which a state’s own body calls
where Dart’s mixin adds its line.Source§fn create_ticker(
self: Handle<Self>,
app: &mut App,
on_tick: FrameCallback,
) -> Retained<Handle<Ticker>>
fn create_ticker( self: Handle<Self>, app: &mut App, on_tick: FrameCallback, ) -> Retained<Handle<Ticker>>
TickerProvider::create_ticker: creates a ticker with the given callback.Auto Trait Implementations§
impl !RefUnwindSafe for OverlayState
impl !Send for OverlayState
impl !Sync for OverlayState
impl !UnwindSafe for OverlayState
impl Forget for OverlayState
impl Freeze for OverlayStatewhere
*const RcInner<dyn Widget> is !null: Freeze,
PhantomData<RcInner<dyn Widget>>: Freeze,
NonZero<u32>: Freeze,
PhantomData<fn() -> StatefulElement>: Freeze,
PhantomData<fn() -> Overlay>: Freeze,
*const u8 is !null: Freeze,
PhantomData<(Retained<Handle<Ticker>>, ())>: Freeze,
*const RcInner<dyn ValueListenable<TickerModeData>> is !null: Freeze,
PhantomData<RcInner<dyn ValueListenable<TickerModeData>>>: Freeze,
PhantomData<Retained<Handle<OverlayEntry>>>: Freeze,
impl Move for OverlayState
impl Unpin for OverlayState
impl UnsafeUnpin for OverlayStatewhere
*const RcInner<dyn Widget> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Widget>>: UnsafeUnpin,
NonZeroU32Inner: UnsafeUnpin,
PhantomData<fn() -> StatefulElement>: UnsafeUnpin,
PhantomData<fn() -> Overlay>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<(Retained<Handle<Ticker>>, ())>: UnsafeUnpin,
*const RcInner<dyn ValueListenable<TickerModeData>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn ValueListenable<TickerModeData>>>: UnsafeUnpin,
PhantomData<Retained<Handle<OverlayEntry>>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.