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§
Source§impl 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§
Source§impl Clone for BindingExpression
impl Clone for BindingExpression
Source§fn clone(&self) -> BindingExpression
fn clone(&self) -> BindingExpression
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for BindingExpression
impl Debug for BindingExpression
Source§impl Deref for BindingExpression
impl Deref for BindingExpression
Source§impl DerefMut for BindingExpression
impl DerefMut for BindingExpression
Source§impl From<Expression> for BindingExpression
impl From<Expression> for BindingExpression
Source§fn from(expression: Expression) -> Self
fn from(expression: Expression) -> Self
Source§impl 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 !Freeze for BindingExpression
impl !RefUnwindSafe for BindingExpression
impl !Send for BindingExpression
impl !Sync for BindingExpression
impl Unpin for BindingExpression
impl !UnwindSafe for BindingExpression
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