pub enum AnyExpr {
Point(Expr<Point>),
Line(Expr<Line>),
Scalar(Expr<Scalar>),
Circle(Expr<Circle>),
PointCollection(Expr<PointCollection>),
Bundle(Expr<Bundle>),
Unknown(Expr<Unknown>),
}
Variants§
Point(Expr<Point>)
Line(Expr<Line>)
Scalar(Expr<Scalar>)
Circle(Expr<Circle>)
PointCollection(Expr<PointCollection>)
Bundle(Expr<Bundle>)
Unknown(Expr<Unknown>)
Implementations§
source§impl AnyExpr
impl AnyExpr
sourcepub fn get_span_mut(&mut self) -> &mut Span
pub fn get_span_mut(&mut self) -> &mut Span
Clones the expression and sets its own span. This will be treated as a separate expression now.
pub fn get_span(&self) -> Span
pub fn replace_node(&mut self, with: Option<AnyExprNode>) -> Option<AnyExprNode>
pub fn get_node(&self) -> Option<&dyn Node>
pub fn as_point(&self) -> Option<&Expr<Point>>
pub fn get_type(&self) -> Type
sourcepub fn convert_to(self, to: Type, context: &CompileContext) -> Self
pub fn convert_to(self, to: Type, context: &CompileContext) -> Self
§Errors
Returns an error if the conversion is invalid.
pub fn can_convert_to(&self, to: Type) -> bool
pub fn can_convert_to_scalar(&self, unit: Option<ComplexUnit>) -> bool
pub fn can_convert_to_collection(&self, len: usize) -> bool
pub fn can_convert_to_bundle(&self, name: &str) -> bool
pub fn boxed(self, span: Span) -> Self
sourcepub fn get_variable_span(&self) -> Span
pub fn get_variable_span(&self) -> Span
§Panics
Panics if not a variable.
pub fn make_variable(self, name: String) -> Self
Trait Implementations§
source§impl CloneWithNode for AnyExpr
impl CloneWithNode for AnyExpr
fn clone_with_node(&mut self) -> Self
fn clone_without_node(&self) -> Self
source§impl ConvertFrom<AnyExpr> for Bundle
impl ConvertFrom<AnyExpr> for Bundle
source§fn convert_from(value: AnyExpr, context: &CompileContext) -> Expr<Self>
fn convert_from(value: AnyExpr, context: &CompileContext) -> Expr<Self>
Errors Read more
fn can_convert_from(value: &AnyExpr) -> bool
source§impl ConvertFrom<AnyExpr> for Circle
impl ConvertFrom<AnyExpr> for Circle
source§fn convert_from(value: AnyExpr, context: &CompileContext) -> Expr<Self>
fn convert_from(value: AnyExpr, context: &CompileContext) -> Expr<Self>
Errors Read more
fn can_convert_from(value: &AnyExpr) -> bool
source§impl ConvertFrom<AnyExpr> for Line
impl ConvertFrom<AnyExpr> for Line
source§fn convert_from(value: AnyExpr, context: &CompileContext) -> Expr<Self>
fn convert_from(value: AnyExpr, context: &CompileContext) -> Expr<Self>
Errors Read more
fn can_convert_from(value: &AnyExpr) -> bool
source§impl ConvertFrom<AnyExpr> for Point
impl ConvertFrom<AnyExpr> for Point
source§fn convert_from(value: AnyExpr, context: &CompileContext) -> Expr<Self>
fn convert_from(value: AnyExpr, context: &CompileContext) -> Expr<Self>
Errors Read more
fn can_convert_from(value: &AnyExpr) -> bool
source§impl ConvertFrom<AnyExpr> for PointCollection
impl ConvertFrom<AnyExpr> for PointCollection
source§fn convert_from(value: AnyExpr, context: &CompileContext) -> Expr<Self>
fn convert_from(value: AnyExpr, context: &CompileContext) -> Expr<Self>
Errors Read more
fn can_convert_from(value: &AnyExpr) -> bool
source§impl ConvertFrom<AnyExpr> for Scalar
impl ConvertFrom<AnyExpr> for Scalar
source§fn convert_from(value: AnyExpr, context: &CompileContext) -> Expr<Self>
fn convert_from(value: AnyExpr, context: &CompileContext) -> Expr<Self>
Errors Read more
fn can_convert_from(value: &AnyExpr) -> bool
source§impl From<Expr<PointCollection>> for AnyExpr
impl From<Expr<PointCollection>> for AnyExpr
source§fn from(value: Expr<PointCollection>) -> Self
fn from(value: Expr<PointCollection>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for AnyExpr
impl !RefUnwindSafe for AnyExpr
impl !Send for AnyExpr
impl !Sync for AnyExpr
impl Unpin for AnyExpr
impl !UnwindSafe for AnyExpr
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
Mutably borrows from an owned value. Read more
source§impl<T> Convert for T
impl<T> Convert for T
source§fn convert<U>(self, context: &CompileContext) -> Expr<U>where
U: ConvertFrom<T>,
fn convert<U>(self, context: &CompileContext) -> Expr<U>where
U: ConvertFrom<T>,
Errors Read more
source§fn can_convert<U>(&self) -> boolwhere
U: ConvertFrom<T>,
fn can_convert<U>(&self) -> boolwhere
U: ConvertFrom<T>,
Errors Read more