pub struct RelativeSource { /* private fields */ }Expand description
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.
Implementations§
Source§impl RelativeSource
impl RelativeSource
Sourcepub fn empty() -> Rc<Self>
pub fn empty() -> Rc<Self>
Creates a relative source in find-ancestor mode (the parameterless constructor).
Sourcepub fn new(mode: RelativeSourceMode) -> Rc<Self>
pub fn new(mode: RelativeSourceMode) -> Rc<Self>
Creates a relative source with the given mode.
Sourcepub fn ancestor_level(&self) -> i32
pub fn ancestor_level(&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.
Sourcepub fn set_ancestor_level(&self, value: i32)
pub fn set_ancestor_level(&self, value: i32)
Sets the ancestor level. Panics if it is not positive.
Sourcepub fn with_ancestor_level(self: Rc<Self>, value: i32) -> Rc<Self>
pub fn with_ancestor_level(self: Rc<Self>, value: i32) -> Rc<Self>
The chaining form of set_ancestor_level.
Sourcepub fn ancestor_type(&self) -> Option<&'static TypeInfo>
pub fn ancestor_type(&self) -> Option<&'static TypeInfo>
The type of ancestor to look for when in
RelativeSourceMode::FindAncestor mode.
pub fn set_ancestor_type(&self, value: Option<&'static TypeInfo>)
Sourcepub fn with_ancestor_type(
self: Rc<Self>,
value: Option<&'static TypeInfo>,
) -> Rc<Self>
pub fn with_ancestor_type( self: Rc<Self>, value: Option<&'static TypeInfo>, ) -> Rc<Self>
The chaining form of set_ancestor_type.
Sourcepub fn mode(&self) -> RelativeSourceMode
pub fn mode(&self) -> RelativeSourceMode
A value that describes the type of relative source lookup.
pub fn set_mode(&self, value: RelativeSourceMode)
Sourcepub fn with_mode(self: Rc<Self>, value: RelativeSourceMode) -> Rc<Self>
pub fn with_mode(self: Rc<Self>, value: RelativeSourceMode) -> Rc<Self>
The chaining form of set_mode.
pub fn set_tree(&self, value: TreeType)
Trait Implementations§
Source§impl Debug for RelativeSource
impl Debug for RelativeSource
Source§impl Default for RelativeSource
impl Default for RelativeSource
Source§impl MarkupTyped for RelativeSource
impl MarkupTyped for RelativeSource
Source§const MARKUP: &'static MarkupType
const MARKUP: &'static MarkupType
Auto Trait Implementations§
impl !Freeze for RelativeSource
impl !RefUnwindSafe for RelativeSource
impl !Sync for RelativeSource
impl Send for RelativeSource
impl Unpin for RelativeSource
impl UnsafeUnpin for RelativeSource
impl UnwindSafe for RelativeSource
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
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> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more