RelativeSource
struct · ferroui-base · v0.5.0
struct RelativeSource
Describes the location of a binding source, relative to the binding target.
A relative source is a mutable reference object: it is created with
RelativeSource::empty or RelativeSource::new, configured property
by property (or with the chaining with_* forms) and shared as
Rc<RelativeSource>. Handles compare by identity. A binding reads it
when it is instantiated on a target.
Members
emptynewancestor_levelset_ancestor_levelwith_ancestor_levelancestor_typeset_ancestor_typewith_ancestor_typemodeset_modewith_modetreeset_treewith_tree
empty
fn empty() -> Rc<Self>
Creates a relative source in find-ancestor mode (the parameterless constructor).
new
fn new(mode: RelativeSourceMode) -> Rc<Self>
Creates a relative source with the given mode.
ancestor_level
fn ancestor_level(self: &Self) -> i32
The level of ancestor to look for when in find-ancestor mode. Use the default value of 1 to look for the first ancestor of the specified type.
set_ancestor_level
fn set_ancestor_level(self: &Self, value: i32)
Sets the ancestor level. Panics if it is not positive.
with_ancestor_level
fn with_ancestor_level(self: Rc<Self>, value: i32) -> Rc<Self>
The chaining form of set_ancestor_level.
ancestor_type
fn ancestor_type(self: &Self) -> Option<&'static TypeInfo>
The type of ancestor to look for when in
RelativeSourceMode::FindAncestor mode.
set_ancestor_type
fn set_ancestor_type(self: &Self, value: Option<&'static TypeInfo>)
with_ancestor_type
fn with_ancestor_type(self: Rc<Self>, value: Option<&'static TypeInfo>) -> Rc<Self>
The chaining form of set_ancestor_type.
mode
fn mode(self: &Self) -> RelativeSourceMode
A value that describes the type of relative source lookup.
set_mode
fn set_mode(self: &Self, value: RelativeSourceMode)
with_mode
fn with_mode(self: Rc<Self>, value: RelativeSourceMode) -> Rc<Self>
The chaining form of set_mode.
tree
fn tree(self: &Self) -> TreeType
The tree in which ancestors are looked up.
set_tree
fn set_tree(self: &Self, value: TreeType)
with_tree
fn with_tree(self: Rc<Self>, value: TreeType) -> Rc<Self>
The chaining form of set_tree.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeAnyValueClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyErasedDestructorIntoEitherDebugDefaultPartialEqMarkupTyped
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.