Struct HandOn
pub struct HandOn<T>where
T: 'static,{ /* private fields */ }Expand description
The hand-on of a widget its view may build anew on every change: the
widget built in its place goes on from the motion this one leaves
(keep), found by the identity it was given, else by its kind and
place.
The widget calls Self::build from build_layout with its identity
(None: it is known by its place) and Self::place from
apply_layout; either returns what a predecessor left, once. Dropped,
the widget leaves its motion for its successor.
Implementations§
§impl<T> HandOn<T>where
T: 'static,
impl<T> HandOn<T>where
T: 'static,
pub fn build(&mut self, identity: Option<&str>) -> Option<T>
pub fn build(&mut self, identity: Option<&str>) -> Option<T>
At its first build, what the widget with the same identity left;
None waits for its place (Self::place).
pub fn place(&mut self, at: Rect) -> Option<T>
pub fn place(&mut self, at: Rect) -> Option<T>
Laid out at at. At its first layout, a widget its identity matched
nothing for takes what was left from this place.
pub fn place_by(&mut self, at: Rect, near: impl Fn(Rect) -> bool) -> Option<T>
pub fn place_by(&mut self, at: Rect, near: impl Fn(Rect) -> bool) -> Option<T>
Self::place, for a widget whose box changes with what it shows
(a badge’s count): near says whether a predecessor laid out at a
place stood where this one stands.
pub fn leave(&mut self, value: T)
pub fn leave(&mut self, value: T)
The widget is dropped: leave value for the one a rebuild puts in
its place. A widget never laid out leaves nothing.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for HandOn<T>
impl<T> RefUnwindSafe for HandOn<T>where
T: RefUnwindSafe,
impl<T> Send for HandOn<T>where
T: Send,
impl<T> Sync for HandOn<T>where
T: Sync,
impl<T> Unpin for HandOn<T>where
T: Unpin,
impl<T> UnsafeUnpin for HandOn<T>
impl<T> UnwindSafe for HandOn<T>where
T: UnwindSafe,
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§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>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§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.§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.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more