pub struct SegmentSlots(/* private fields */);Expand description
Shared handle to the geometry the widget publishes each layout pass and the chrome reads at paint time.
The widget’s place_children always runs before its children paint,
so a chrome reading this during paint always sees the current pass’s
values. Before the first layout it is empty, and the chrome must treat
that as “nothing to draw” rather than as an error.
Implementations§
Source§impl SegmentSlots
impl SegmentSlots
Sourcepub fn publish(&self, geometry: SegmentSlotGeometry)
pub fn publish(&self, geometry: SegmentSlotGeometry)
Replace the published geometry. Called from the widget’s
place_children.
Sourcepub fn with<R>(&self, f: impl FnOnce(&SegmentSlotGeometry) -> R) -> R
pub fn with<R>(&self, f: impl FnOnce(&SegmentSlotGeometry) -> R) -> R
Read the published geometry.
Sourcepub fn slot_of(&self, segment: usize) -> Option<usize>
pub fn slot_of(&self, segment: usize) -> Option<usize>
The slot a live segment currently occupies, if it is on the strip.
Returns None for a segment that overflowed into the menu.
Trait Implementations§
Source§impl Clone for SegmentSlots
impl Clone for SegmentSlots
Source§fn clone(&self) -> SegmentSlots
fn clone(&self) -> SegmentSlots
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SegmentSlots
impl Debug for SegmentSlots
Source§impl Default for SegmentSlots
impl Default for SegmentSlots
Source§fn default() -> SegmentSlots
fn default() -> SegmentSlots
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for SegmentSlots
impl !Send for SegmentSlots
impl !Sync for SegmentSlots
impl !UnwindSafe for SegmentSlots
impl Freeze for SegmentSlots
impl Unpin for SegmentSlots
impl UnsafeUnpin for SegmentSlots
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
Mutably borrows from an owned value. Read more