pub struct TreeNodeFlags { /* private fields */ }
Expand description
Flags for tree nodes
Implementations§
Source§impl TreeNodeFlags
impl TreeNodeFlags
Sourcepub const SELECTED: TreeNodeFlags
pub const SELECTED: TreeNodeFlags
Draw as selected
Sourcepub const FRAMED: TreeNodeFlags
pub const FRAMED: TreeNodeFlags
Full colored frame (e.g. for CollapsingHeader)
Sourcepub const ALLOW_ITEM_OVERLAP: TreeNodeFlags
pub const ALLOW_ITEM_OVERLAP: TreeNodeFlags
Hit testing to allow subsequent widgets to overlap this one
Sourcepub const NO_TREE_PUSH_ON_OPEN: TreeNodeFlags
pub const NO_TREE_PUSH_ON_OPEN: TreeNodeFlags
Don’t push a tree node when open (e.g. for CollapsingHeader) = no extra indent nor pushing on ID stack
Sourcepub const NO_AUTO_OPEN_ON_LOG: TreeNodeFlags
pub const NO_AUTO_OPEN_ON_LOG: TreeNodeFlags
Don’t automatically and temporarily open node when Logging is active (by default logging will automatically open tree nodes)
Sourcepub const DEFAULT_OPEN: TreeNodeFlags
pub const DEFAULT_OPEN: TreeNodeFlags
Default node to be open
Sourcepub const OPEN_ON_DOUBLE_CLICK: TreeNodeFlags
pub const OPEN_ON_DOUBLE_CLICK: TreeNodeFlags
Need double-click to open node
Sourcepub const OPEN_ON_ARROW: TreeNodeFlags
pub const OPEN_ON_ARROW: TreeNodeFlags
Only open when clicking on the arrow part.
If TreeNodeFlags::OPEN_ON_DOUBLE_CLICK
is also set, single-click arrow or
double-click all box to open.
Sourcepub const LEAF: TreeNodeFlags
pub const LEAF: TreeNodeFlags
No collapsing, no arrow (use as a convenience for leaf nodes)
Sourcepub const BULLET: TreeNodeFlags
pub const BULLET: TreeNodeFlags
Display a bullet instead of arrow
Sourcepub const FRAME_PADDING: TreeNodeFlags
pub const FRAME_PADDING: TreeNodeFlags
Use Style::frame_padding
(even for an unframed text node) to vertically align text
baseline to regular widget height.
Equivalent to calling Ui::align_text_to_frame_padding
.
Sourcepub const SPAN_AVAIL_WIDTH: TreeNodeFlags
pub const SPAN_AVAIL_WIDTH: TreeNodeFlags
Extend hit box to the right-most edge, even if not framed.
This is not the default in order to allow adding other items on the same line. In the future we may refactor the hit system to be front-to-back, allowing natural overlaps and then this can become the default.
Sourcepub const SPAN_FULL_WIDTH: TreeNodeFlags
pub const SPAN_FULL_WIDTH: TreeNodeFlags
Extend hit box to the left-most and right-most edges (bypass the indented area)
Sourcepub const NAV_LEFT_JUMPS_BACK_HERE: TreeNodeFlags
pub const NAV_LEFT_JUMPS_BACK_HERE: TreeNodeFlags
(WIP) Nav: left direction may move to this tree node from any of its child
Sourcepub const fn empty() -> TreeNodeFlags
pub const fn empty() -> TreeNodeFlags
Returns an empty set of flags.
Sourcepub const fn all() -> TreeNodeFlags
pub const fn all() -> TreeNodeFlags
Returns the set containing all flags.
Sourcepub const fn from_bits(bits: u32) -> Option<TreeNodeFlags>
pub const fn from_bits(bits: u32) -> Option<TreeNodeFlags>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
Sourcepub const fn from_bits_truncate(bits: u32) -> TreeNodeFlags
pub const fn from_bits_truncate(bits: u32) -> TreeNodeFlags
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
Sourcepub const unsafe fn from_bits_unchecked(bits: u32) -> TreeNodeFlags
pub const unsafe fn from_bits_unchecked(bits: u32) -> TreeNodeFlags
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
§Safety
The caller of the bitflags!
macro can chose to allow or
disallow extra bits for their bitflags type.
The caller of from_bits_unchecked()
has to ensure that
all bits correspond to a defined flag or that extra bits
are valid for this bitflags type.
Sourcepub const fn intersects(&self, other: TreeNodeFlags) -> bool
pub const fn intersects(&self, other: TreeNodeFlags) -> bool
Returns true
if there are flags common to both self
and other
.
Sourcepub const fn contains(&self, other: TreeNodeFlags) -> bool
pub const fn contains(&self, other: TreeNodeFlags) -> bool
Returns true
if all of the flags in other
are contained within self
.
Sourcepub fn insert(&mut self, other: TreeNodeFlags)
pub fn insert(&mut self, other: TreeNodeFlags)
Inserts the specified flags in-place.
Sourcepub fn remove(&mut self, other: TreeNodeFlags)
pub fn remove(&mut self, other: TreeNodeFlags)
Removes the specified flags in-place.
Sourcepub fn toggle(&mut self, other: TreeNodeFlags)
pub fn toggle(&mut self, other: TreeNodeFlags)
Toggles the specified flags in-place.
Sourcepub fn set(&mut self, other: TreeNodeFlags, value: bool)
pub fn set(&mut self, other: TreeNodeFlags, value: bool)
Inserts or removes the specified flags depending on the passed value.
Sourcepub const fn intersection(self, other: TreeNodeFlags) -> TreeNodeFlags
pub const fn intersection(self, other: TreeNodeFlags) -> TreeNodeFlags
Returns the intersection between the flags in self
and
other
.
Specifically, the returned set contains only the flags which are
present in both self
and other
.
This is equivalent to using the &
operator (e.g.
ops::BitAnd
), as in flags & other
.
Sourcepub const fn union(self, other: TreeNodeFlags) -> TreeNodeFlags
pub const fn union(self, other: TreeNodeFlags) -> TreeNodeFlags
Returns the union of between the flags in self
and other
.
Specifically, the returned set contains all flags which are
present in either self
or other
, including any which are
present in both (see Self::symmetric_difference
if that
is undesirable).
This is equivalent to using the |
operator (e.g.
ops::BitOr
), as in flags | other
.
Sourcepub const fn difference(self, other: TreeNodeFlags) -> TreeNodeFlags
pub const fn difference(self, other: TreeNodeFlags) -> TreeNodeFlags
Returns the difference between the flags in self
and other
.
Specifically, the returned set contains all flags present in
self
, except for the ones present in other
.
It is also conceptually equivalent to the “bit-clear” operation:
flags & !other
(and this syntax is also supported).
This is equivalent to using the -
operator (e.g.
ops::Sub
), as in flags - other
.
Sourcepub const fn symmetric_difference(self, other: TreeNodeFlags) -> TreeNodeFlags
pub const fn symmetric_difference(self, other: TreeNodeFlags) -> TreeNodeFlags
Returns the symmetric difference between the flags
in self
and other
.
Specifically, the returned set contains the flags present which
are present in self
or other
, but that are not present in
both. Equivalently, it contains the flags present in exactly
one of the sets self
and other
.
This is equivalent to using the ^
operator (e.g.
ops::BitXor
), as in flags ^ other
.
Sourcepub const fn complement(self) -> TreeNodeFlags
pub const fn complement(self) -> TreeNodeFlags
Returns the complement of this set of flags.
Specifically, the returned set contains all the flags which are
not set in self
, but which are allowed for this type.
Alternatively, it can be thought of as the set difference
between Self::all()
and self
(e.g. Self::all() - self
)
This is equivalent to using the !
operator (e.g.
ops::Not
), as in !flags
.
Trait Implementations§
Source§impl Binary for TreeNodeFlags
impl Binary for TreeNodeFlags
Source§impl BitAnd for TreeNodeFlags
impl BitAnd for TreeNodeFlags
Source§fn bitand(self, other: TreeNodeFlags) -> TreeNodeFlags
fn bitand(self, other: TreeNodeFlags) -> TreeNodeFlags
Returns the intersection between the two sets of flags.
Source§type Output = TreeNodeFlags
type Output = TreeNodeFlags
&
operator.Source§impl BitAndAssign for TreeNodeFlags
impl BitAndAssign for TreeNodeFlags
Source§fn bitand_assign(&mut self, other: TreeNodeFlags)
fn bitand_assign(&mut self, other: TreeNodeFlags)
Disables all flags disabled in the set.
Source§impl BitOr for TreeNodeFlags
impl BitOr for TreeNodeFlags
Source§fn bitor(self, other: TreeNodeFlags) -> TreeNodeFlags
fn bitor(self, other: TreeNodeFlags) -> TreeNodeFlags
Returns the union of the two sets of flags.
Source§type Output = TreeNodeFlags
type Output = TreeNodeFlags
|
operator.Source§impl BitOrAssign for TreeNodeFlags
impl BitOrAssign for TreeNodeFlags
Source§fn bitor_assign(&mut self, other: TreeNodeFlags)
fn bitor_assign(&mut self, other: TreeNodeFlags)
Adds the set of flags.
Source§impl BitXor for TreeNodeFlags
impl BitXor for TreeNodeFlags
Source§fn bitxor(self, other: TreeNodeFlags) -> TreeNodeFlags
fn bitxor(self, other: TreeNodeFlags) -> TreeNodeFlags
Returns the left flags, but with all the right flags toggled.
Source§type Output = TreeNodeFlags
type Output = TreeNodeFlags
^
operator.Source§impl BitXorAssign for TreeNodeFlags
impl BitXorAssign for TreeNodeFlags
Source§fn bitxor_assign(&mut self, other: TreeNodeFlags)
fn bitxor_assign(&mut self, other: TreeNodeFlags)
Toggles the set of flags.
Source§impl Clone for TreeNodeFlags
impl Clone for TreeNodeFlags
Source§fn clone(&self) -> TreeNodeFlags
fn clone(&self) -> TreeNodeFlags
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TreeNodeFlags
impl Debug for TreeNodeFlags
Source§impl Extend<TreeNodeFlags> for TreeNodeFlags
impl Extend<TreeNodeFlags> for TreeNodeFlags
Source§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = TreeNodeFlags>,
fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = TreeNodeFlags>,
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Source§impl FromIterator<TreeNodeFlags> for TreeNodeFlags
impl FromIterator<TreeNodeFlags> for TreeNodeFlags
Source§fn from_iter<T>(iterator: T) -> TreeNodeFlagswhere
T: IntoIterator<Item = TreeNodeFlags>,
fn from_iter<T>(iterator: T) -> TreeNodeFlagswhere
T: IntoIterator<Item = TreeNodeFlags>,
Source§impl Hash for TreeNodeFlags
impl Hash for TreeNodeFlags
Source§impl LowerHex for TreeNodeFlags
impl LowerHex for TreeNodeFlags
Source§impl Not for TreeNodeFlags
impl Not for TreeNodeFlags
Source§fn not(self) -> TreeNodeFlags
fn not(self) -> TreeNodeFlags
Returns the complement of this set of flags.
Source§type Output = TreeNodeFlags
type Output = TreeNodeFlags
!
operator.Source§impl Octal for TreeNodeFlags
impl Octal for TreeNodeFlags
Source§impl Ord for TreeNodeFlags
impl Ord for TreeNodeFlags
Source§fn cmp(&self, other: &TreeNodeFlags) -> Ordering
fn cmp(&self, other: &TreeNodeFlags) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for TreeNodeFlags
impl PartialEq for TreeNodeFlags
Source§impl PartialOrd for TreeNodeFlags
impl PartialOrd for TreeNodeFlags
Source§impl Sub for TreeNodeFlags
impl Sub for TreeNodeFlags
Source§fn sub(self, other: TreeNodeFlags) -> TreeNodeFlags
fn sub(self, other: TreeNodeFlags) -> TreeNodeFlags
Returns the set difference of the two sets of flags.
Source§type Output = TreeNodeFlags
type Output = TreeNodeFlags
-
operator.Source§impl SubAssign for TreeNodeFlags
impl SubAssign for TreeNodeFlags
Source§fn sub_assign(&mut self, other: TreeNodeFlags)
fn sub_assign(&mut self, other: TreeNodeFlags)
Disables all flags enabled in the set.
Source§impl UpperHex for TreeNodeFlags
impl UpperHex for TreeNodeFlags
impl Copy for TreeNodeFlags
impl Eq for TreeNodeFlags
impl StructuralPartialEq for TreeNodeFlags
Auto Trait Implementations§
impl Freeze for TreeNodeFlags
impl RefUnwindSafe for TreeNodeFlags
impl Send for TreeNodeFlags
impl Sync for TreeNodeFlags
impl Unpin for TreeNodeFlags
impl UnwindSafe for TreeNodeFlags
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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