Skip to main content

RelativeSource

Struct RelativeSource 

Source
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

Source

pub fn empty() -> Rc<Self>

Creates a relative source in find-ancestor mode (the parameterless constructor).

Source

pub fn new(mode: RelativeSourceMode) -> Rc<Self>

Creates a relative source with the given mode.

Source

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.

Source

pub fn set_ancestor_level(&self, value: i32)

Sets the ancestor level. Panics if it is not positive.

Source

pub fn with_ancestor_level(self: Rc<Self>, value: i32) -> Rc<Self>

The chaining form of set_ancestor_level.

Source

pub fn ancestor_type(&self) -> Option<&'static TypeInfo>

The type of ancestor to look for when in RelativeSourceMode::FindAncestor mode.

Source

pub fn set_ancestor_type(&self, value: Option<&'static TypeInfo>)

Source

pub fn with_ancestor_type( self: Rc<Self>, value: Option<&'static TypeInfo>, ) -> Rc<Self>

The chaining form of set_ancestor_type.

Source

pub fn mode(&self) -> RelativeSourceMode

A value that describes the type of relative source lookup.

Source

pub fn set_mode(&self, value: RelativeSourceMode)

Source

pub fn with_mode(self: Rc<Self>, value: RelativeSourceMode) -> Rc<Self>

The chaining form of set_mode.

Source

pub fn tree(&self) -> TreeType

The tree in which ancestors are looked up.

Source

pub fn set_tree(&self, value: TreeType)

Source

pub fn with_tree(self: Rc<Self>, value: TreeType) -> Rc<Self>

The chaining form of set_tree.

Trait Implementations§

Source§

impl Debug for RelativeSource

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RelativeSource

Source§

fn default() -> Self

A relative source in find-ancestor mode.

Source§

impl MarkupTyped for RelativeSource

Source§

const MARKUP: &'static MarkupType

The markup metadata of the type.
Source§

impl PartialEq for RelativeSource

Compares by identity (reference equality), as the reference type this mirrors.

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AnyValue for T
where T: PartialEq + 'static,

Source§

fn any_value_as_any(&self) -> &(dyn Any + 'static)

Source§

fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool

Source§

fn any_value_type_name(&self) -> &'static str

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.