Enum geo_aid::script::unroll::AnyExpr

source ·
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

source

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.

source

pub fn get_span(&self) -> Span

source

pub fn replace_node(&mut self, with: Option<AnyExprNode>) -> Option<AnyExprNode>

source

pub fn get_node(&self) -> Option<&dyn Node>

source

pub fn as_point(&self) -> Option<&Expr<Point>>

source

pub fn get_type(&self) -> Type

source

pub fn convert_to(self, to: Type, context: &CompileContext) -> Self

§Errors

Returns an error if the conversion is invalid.

source

pub fn can_convert_to(&self, to: Type) -> bool

source

pub fn can_convert_to_scalar(&self, unit: Option<ComplexUnit>) -> bool

source

pub fn can_convert_to_collection(&self, len: usize) -> bool

source

pub fn can_convert_to_bundle(&self, name: &str) -> bool

source

pub fn boxed(self, span: Span) -> Self

source

pub fn get_variable_span(&self) -> Span

§Panics

Panics if not a variable.

source

pub fn make_variable(self, name: String) -> Self

Trait Implementations§

source§

impl CloneWithNode for AnyExpr

source§

fn clone_with_node(&mut self) -> Self

source§

fn clone_without_node(&self) -> Self

source§

impl ConvertFrom<AnyExpr> for Bundle

source§

impl ConvertFrom<AnyExpr> for Circle

source§

impl ConvertFrom<AnyExpr> for Line

source§

impl ConvertFrom<AnyExpr> for Point

source§

impl ConvertFrom<AnyExpr> for PointCollection

source§

impl ConvertFrom<AnyExpr> for Scalar

source§

impl Debug for AnyExpr

source§

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

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

impl Display for AnyExpr

source§

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

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

impl Dummy for AnyExpr

source§

fn dummy() -> Self

source§

fn is_dummy(&self) -> bool

source§

impl From<Expr<Bundle>> for AnyExpr

source§

fn from(value: Expr<Bundle>) -> Self

Converts to this type from the input type.
source§

impl From<Expr<Circle>> for AnyExpr

source§

fn from(value: Expr<Circle>) -> Self

Converts to this type from the input type.
source§

impl From<Expr<Line>> for AnyExpr

source§

fn from(value: Expr<Line>) -> Self

Converts to this type from the input type.
source§

impl From<Expr<Point>> for AnyExpr

source§

fn from(value: Expr<Point>) -> Self

Converts to this type from the input type.
source§

impl From<Expr<PointCollection>> for AnyExpr

source§

fn from(value: Expr<PointCollection>) -> Self

Converts to this type from the input type.
source§

impl From<Expr<Scalar>> for AnyExpr

source§

fn from(value: Expr<Scalar>) -> Self

Converts to this type from the input type.
source§

impl From<Expr<Unknown>> for AnyExpr

source§

fn from(value: Expr<Unknown>) -> 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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
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> Convert for T

source§

fn convert<U>(self, context: &CompileContext) -> Expr<U>
where U: ConvertFrom<T>,

Errors Read more
source§

fn can_convert<U>(&self) -> bool
where U: ConvertFrom<T>,

Errors 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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V