Struct zng_app::widget::info::InteractionPath
source · pub struct InteractionPath { /* private fields */ }
Expand description
Represents a WidgetPath
annotated with each widget’s Interactivity
.
Implementations§
source§impl InteractionPath
impl InteractionPath
sourcepub fn new<P: IntoIterator<Item = (WidgetId, Interactivity)>>(
window_id: WindowId,
path: P,
) -> InteractionPath
pub fn new<P: IntoIterator<Item = (WidgetId, Interactivity)>>( window_id: WindowId, path: P, ) -> InteractionPath
New custom path.
sourcepub fn new_enabled(
window_id: WindowId,
path: Arc<Vec<WidgetId>>,
) -> InteractionPath
pub fn new_enabled( window_id: WindowId, path: Arc<Vec<WidgetId>>, ) -> InteractionPath
New custom path with all widgets enabled.
sourcepub fn from_enabled(path: WidgetPath) -> InteractionPath
pub fn from_enabled(path: WidgetPath) -> InteractionPath
New interactivity path with all widgets enabled.
sourcepub fn as_path(&self) -> &WidgetPath
pub fn as_path(&self) -> &WidgetPath
Dereferences to the path.
sourcepub fn blocked_index(&self) -> Option<usize>
pub fn blocked_index(&self) -> Option<usize>
Index of first BLOCKED
.
sourcepub fn disabled_index(&self) -> Option<usize>
pub fn disabled_index(&self) -> Option<usize>
Index of first DISABLED
.
sourcepub fn interaction_path(
&self,
) -> impl DoubleEndedIterator<Item = Interactivity> + ExactSizeIterator
pub fn interaction_path( &self, ) -> impl DoubleEndedIterator<Item = Interactivity> + ExactSizeIterator
Interactivity for each widget, root first.
sourcepub fn interactivity_of(&self, widget_id: WidgetId) -> Option<Interactivity>
pub fn interactivity_of(&self, widget_id: WidgetId) -> Option<Interactivity>
Search for the interactivity value associated with the widget in the path.
sourcepub fn interactivity(&self) -> Interactivity
pub fn interactivity(&self) -> Interactivity
Interactivity of the widget.
sourcepub fn zip(
&self,
) -> impl DoubleEndedIterator<Item = (WidgetId, Interactivity)> + ExactSizeIterator + '_
pub fn zip( &self, ) -> impl DoubleEndedIterator<Item = (WidgetId, Interactivity)> + ExactSizeIterator + '_
Zip widgets and interactivity.
sourcepub fn unblocked(self) -> Option<InteractionPath>
pub fn unblocked(self) -> Option<InteractionPath>
sourcepub fn enabled(self) -> Option<WidgetPath>
pub fn enabled(self) -> Option<WidgetPath>
Gets the ENABLED
part of the path, or none if the widget is not enabled at the root.
sourcepub fn ancestor_path(
&self,
ancestor_id: WidgetId,
) -> Option<Cow<'_, InteractionPath>>
pub fn ancestor_path( &self, ancestor_id: WidgetId, ) -> Option<Cow<'_, InteractionPath>>
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
with the same interactivity.
sourcepub fn root_path(&self) -> Cow<'_, InteractionPath>
pub fn root_path(&self) -> Cow<'_, InteractionPath>
Gets a path to the root widget of this path.
Methods from Deref<Target = WidgetPath>§
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 InteractionPath
impl Clone for InteractionPath
source§fn clone(&self) -> InteractionPath
fn clone(&self) -> InteractionPath
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for InteractionPath
impl Debug for InteractionPath
source§impl Deref for InteractionPath
impl Deref for InteractionPath
source§impl Display for InteractionPath
impl Display for InteractionPath
source§impl From<InteractionPath> for WidgetPath
impl From<InteractionPath> for WidgetPath
source§fn from(p: InteractionPath) -> Self
fn from(p: InteractionPath) -> Self
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 InteractionPath
impl PartialEq for InteractionPath
source§impl WidgetPathProvider for InteractionPath
impl WidgetPathProvider for InteractionPath
source§fn widget_and_ancestors(&self) -> Self::WidgetIter<'_>
fn widget_and_ancestors(&self) -> Self::WidgetIter<'_>
impl Eq for InteractionPath
Auto Trait Implementations§
impl Freeze for InteractionPath
impl RefUnwindSafe for InteractionPath
impl Send for InteractionPath
impl Sync for InteractionPath
impl Unpin for InteractionPath
impl UnwindSafe for InteractionPath
Blanket Implementations§
source§impl<T> AnyVarValue for Twhere
T: VarValue,
impl<T> AnyVarValue for Twhere
T: VarValue,
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
dyn Any
methods.source§fn clone_boxed(&self) -> Box<dyn AnyVarValue>
fn clone_boxed(&self) -> Box<dyn AnyVarValue>
source§fn clone_boxed_var(&self) -> Box<dyn AnyVar>
fn clone_boxed_var(&self) -> Box<dyn AnyVar>
LocalVar<Self>
.source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
self
equals other
.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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§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