pub struct BindingExpression {
pub expression: Expression,
pub span: Option<SourceLocation>,
pub priority: i32,
pub animation: Option<PropertyAnimation>,
pub analysis: Option<BindingAnalysis>,
pub two_way_bindings: Vec<NamedReference>,
}
Expand description
The expression in the Element::binding hash table
Fields
expression: Expression
span: Option<SourceLocation>
The location of this expression in the source code
priority: i32
How deep is this binding declared in the hierarchy. When two binding are conflicting for the same priority (because of two way binding), the lower priority wins. The priority starts at 1, and each level of inlining adds one to the priority. 0 means the expression was added by some passes and it is not explicit in the source code
animation: Option<PropertyAnimation>
analysis: Option<BindingAnalysis>
The analysis information. None before it is computed
two_way_bindings: Vec<NamedReference>
The properties this expression is aliased with using two way bindings
Implementations
sourceimpl BindingExpression
impl BindingExpression
pub fn new_uncompiled(node: SyntaxNode) -> Self
pub fn new_with_span(expression: Expression, span: SourceLocation) -> Self
sourcepub fn new_two_way(other: NamedReference) -> Self
pub fn new_two_way(other: NamedReference) -> Self
Create an expression binding that simply is a two way binding to the other
sourcepub fn merge_with(&mut self, other: &Self) -> bool
pub fn merge_with(&mut self, other: &Self) -> bool
Merge the other into this one. Normally, &self is kept intact (has priority) unless the expression is invalid, in which case the other one is taken.
Also the animation is taken if the other don’t have one, and the two ways binding are taken into account.
Returns true if the other expression was taken
sourcepub fn has_binding(&self) -> bool
pub fn has_binding(&self) -> bool
returns false if there is no expression or two way binding
Methods from Deref<Target = Expression>
sourcepub fn visit(&self, visitor: impl FnMut(&Self))
pub fn visit(&self, visitor: impl FnMut(&Self))
Call the visitor for each sub-expression. (note: this function does not recurse)
pub fn visit_mut(&mut self, visitor: impl FnMut(&mut Self))
sourcepub fn visit_recursive(&self, visitor: &mut dyn FnMut(&Self))
pub fn visit_recursive(&self, visitor: &mut dyn FnMut(&Self))
Visit itself and each sub expression recursively
sourcepub fn visit_recursive_mut(&mut self, visitor: &mut dyn FnMut(&mut Self))
pub fn visit_recursive_mut(&mut self, visitor: &mut dyn FnMut(&mut Self))
Visit itself and each sub expression recursively
pub fn is_constant(&self) -> bool
sourcepub fn try_set_rw(&mut self) -> bool
pub fn try_set_rw(&mut self) -> bool
Try to mark this expression to a lvalue that can be assigned to.
Return true if the expression is a “lvalue” that can be used as the left hand side of a =
or +=
or similar
Trait Implementations
sourceimpl Clone for BindingExpression
impl Clone for BindingExpression
sourcefn clone(&self) -> BindingExpression
fn clone(&self) -> BindingExpression
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for BindingExpression
impl Debug for BindingExpression
sourceimpl Deref for BindingExpression
impl Deref for BindingExpression
type Target = Expression
type Target = Expression
The resulting type after dereferencing.
sourceimpl DerefMut for BindingExpression
impl DerefMut for BindingExpression
sourceimpl From<Expression> for BindingExpression
impl From<Expression> for BindingExpression
sourcefn from(expression: Expression) -> Self
fn from(expression: Expression) -> Self
Performs the conversion.
sourceimpl Spanned for BindingExpression
impl Spanned for BindingExpression
fn span(&self) -> Span
fn source_file(&self) -> Option<&SourceFile>
fn to_source_location(&self) -> SourceLocation
Auto Trait Implementations
impl !RefUnwindSafe for BindingExpression
impl !Send for BindingExpression
impl !Sync for BindingExpression
impl Unpin for BindingExpression
impl !UnwindSafe for BindingExpression
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more