pub struct WidgetPath { /* private fields */ }Expand description
Full address of a widget.
The path is reference counted, cloning this struct does not alloc.
Implementations§
Source§impl WidgetPath
impl WidgetPath
Sourcepub fn new(window_id: WindowId, path: Arc<Vec<WidgetId>>) -> WidgetPath
pub fn new(window_id: WindowId, path: Arc<Vec<WidgetId>>) -> WidgetPath
New custom widget path.
Sourcepub fn widgets_path(&self) -> &[WidgetId]
pub fn widgets_path(&self) -> &[WidgetId]
Sourcepub fn ancestor_path(
&self,
ancestor_id: WidgetId,
) -> Option<Cow<'_, WidgetPath>>
pub fn ancestor_path( &self, ancestor_id: WidgetId, ) -> Option<Cow<'_, WidgetPath>>
Make a path to an ancestor id that is contained in the current path.
Get the inner most widget parent shared by both self and other.
Sourcepub fn root_path(&self) -> Cow<'_, WidgetPath>
pub fn root_path(&self) -> Cow<'_, WidgetPath>
Gets a path to the root widget of this path.
Trait Implementations§
Source§impl Clone for WidgetPath
impl Clone for WidgetPath
Source§fn clone(&self) -> WidgetPath
fn clone(&self) -> WidgetPath
Returns a duplicate of the value. Read more
1.0.0 · 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 WidgetPath
impl Debug for WidgetPath
Source§impl Display for WidgetPath
impl Display for WidgetPath
Source§impl From<InteractionPath> for WidgetPath
impl From<InteractionPath> for WidgetPath
Source§fn from(p: InteractionPath) -> Self
fn from(p: InteractionPath) -> Self
Converts to this type from the input type.
Source§impl PartialEq<InteractionPath> for WidgetPath
impl PartialEq<InteractionPath> for WidgetPath
Source§impl PartialEq<WidgetPath> for InteractionPath
impl PartialEq<WidgetPath> for InteractionPath
Source§impl PartialEq for WidgetPath
impl PartialEq for WidgetPath
Source§impl WidgetPathProvider for WidgetPath
impl WidgetPathProvider for WidgetPath
Source§fn widget_and_ancestors(&self) -> Self::WidgetIter<'_>
fn widget_and_ancestors(&self) -> Self::WidgetIter<'_>
Iterate over the widget, parent, grandparent, .., root.
impl Eq for WidgetPath
Auto Trait Implementations§
impl Freeze for WidgetPath
impl RefUnwindSafe for WidgetPath
impl Send for WidgetPath
impl Sync for WidgetPath
impl Unpin for WidgetPath
impl UnwindSafe for WidgetPath
Blanket Implementations§
Source§impl<T> AnyVarValue for T
impl<T> AnyVarValue for T
Source§fn clone_boxed(&self) -> BoxAnyVarValue
fn clone_boxed(&self) -> BoxAnyVarValue
Clone the value.
Source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
Gets if
self and other are equal.Source§fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
Swap value with
other if both are of the same type.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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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