Struct geo_aid::script::unroll::Expr

source ·
pub struct Expr<T: ?Sized + Displayed> {
    pub data: Rc<T>,
    pub span: Span,
    pub weight: FastFloat,
    pub node: Option<HierarchyNode<T::Node>>,
}

Fields§

§data: Rc<T>§span: Span§weight: FastFloat§node: Option<HierarchyNode<T::Node>>

Implementations§

source§

impl Expr<Point>

source

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

source§

impl Expr<Point>

source

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

source§

impl Expr<Circle>

source

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

source§

impl Expr<Circle>

source

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

source§

impl Expr<Line>

source

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

source§

impl Expr<Line>

source

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

source§

impl Expr<Scalar>

source

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

source§

impl Expr<Scalar>

source

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

source

pub fn convert_unit( self, unit: Option<ComplexUnit>, context: &CompileContext ) -> Self

Errors

Returns a conversion error if it is invalid.

Only valid conversions are None to another unit or self to self

source

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

Checks whether a unit conversion can be performed

source

pub fn specify_unit(self, context: &CompileContext) -> Self

Panics

If bugged

source§

impl Expr<PointCollection>

source

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

source§

impl Expr<PointCollection>

source

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

source

pub fn check_len(self, length: usize, context: &CompileContext) -> Self

Errors

Returns an error if lengths don’t match up.

source

pub fn index_without_node(&self, index: usize) -> Expr<Point>

source

pub fn index_with_node(&mut self, index: usize) -> Expr<Point>

Also takes the collection’s node.

source§

impl Expr<Bundle>

source

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

source§

impl Expr<Bundle>

source

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

source

pub fn index_without_node(&self, field: &str) -> AnyExpr

source

pub fn index_with_node(&mut self, field: &str) -> AnyExpr

Panics

Panics if the given field does not exist.

source

pub fn check_name(self, name: &'static str, context: &CompileContext) -> Self

Errors

Returns an error if the bundle names don’t match

source§

impl Expr<Unknown>

source

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

source§

impl Expr<Unknown>

source

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

source§

impl<T: CloneWithNode + Displayed> Expr<T>

source

pub fn new_spanless(data: T) -> Self

Creates a new expression without a declared span. WARNING: the expression has no node.

source

pub fn with_weight(self, weight: FastFloat) -> Self

source

pub fn take_node(&mut self) -> Option<HierarchyNode<T::Node>>

source§

impl<T: CloneWithNode + Displayed> Expr<T>
where Expr<T>: Simplify,

source

pub fn simplify_with_node(&mut self, context: &CompileContext) -> Self

Trait Implementations§

source§

impl<T: ?Sized + Displayed> CloneWithNode for Expr<T>

source§

fn clone_with_node(&mut self) -> Self

source§

fn clone_without_node(&self) -> Self

source§

impl ConvertFrom<Expr<Bundle>> for Bundle

source§

fn convert_from(value: Expr<Bundle>, _context: &CompileContext) -> Expr<Self>

Errors Read more
source§

fn can_convert_from(_value: &Expr<Bundle>) -> bool

source§

impl ConvertFrom<Expr<Bundle>> for Circle

source§

impl ConvertFrom<Expr<Bundle>> for Line

source§

impl ConvertFrom<Expr<Bundle>> for Point

source§

impl ConvertFrom<Expr<Bundle>> for PointCollection

source§

impl ConvertFrom<Expr<Bundle>> for Scalar

source§

impl ConvertFrom<Expr<Circle>> for Bundle

source§

impl ConvertFrom<Expr<Circle>> for Circle

source§

fn convert_from(value: Expr<Circle>, _context: &CompileContext) -> Expr<Self>

Errors Read more
source§

fn can_convert_from(_value: &Expr<Circle>) -> bool

source§

impl ConvertFrom<Expr<Circle>> for Line

source§

impl ConvertFrom<Expr<Circle>> for Point

source§

impl ConvertFrom<Expr<Circle>> for PointCollection

source§

impl ConvertFrom<Expr<Circle>> for Scalar

source§

impl ConvertFrom<Expr<Line>> for Bundle

source§

fn convert_from(value: Expr<Line>, context: &CompileContext) -> Expr<Self>

Errors Read more
source§

fn can_convert_from(_value: &Expr<Line>) -> bool

source§

impl ConvertFrom<Expr<Line>> for Circle

source§

fn convert_from(value: Expr<Line>, context: &CompileContext) -> Expr<Self>

Errors Read more
source§

fn can_convert_from(_value: &Expr<Line>) -> bool

source§

impl ConvertFrom<Expr<Line>> for Line

source§

fn convert_from(value: Expr<Line>, _context: &CompileContext) -> Expr<Self>

Errors Read more
source§

fn can_convert_from(_value: &Expr<Line>) -> bool

source§

impl ConvertFrom<Expr<Line>> for Point

source§

fn convert_from(value: Expr<Line>, context: &CompileContext) -> Expr<Self>

Errors Read more
source§

fn can_convert_from(_value: &Expr<Line>) -> bool

source§

impl ConvertFrom<Expr<Line>> for PointCollection

source§

fn convert_from(value: Expr<Line>, context: &CompileContext) -> Expr<Self>

Errors Read more
source§

fn can_convert_from(_value: &Expr<Line>) -> bool

source§

impl ConvertFrom<Expr<Line>> for Scalar

source§

fn convert_from(value: Expr<Line>, context: &CompileContext) -> Expr<Self>

Errors Read more
source§

fn can_convert_from(_value: &Expr<Line>) -> bool

source§

impl ConvertFrom<Expr<Point>> for Bundle

source§

fn convert_from(value: Expr<Point>, context: &CompileContext) -> Expr<Self>

Errors Read more
source§

fn can_convert_from(_value: &Expr<Point>) -> bool

source§

impl ConvertFrom<Expr<Point>> for Circle

source§

fn convert_from(value: Expr<Point>, context: &CompileContext) -> Expr<Self>

Errors Read more
source§

fn can_convert_from(_value: &Expr<Point>) -> bool

source§

impl ConvertFrom<Expr<Point>> for Line

source§

fn convert_from(value: Expr<Point>, context: &CompileContext) -> Expr<Self>

Errors Read more
source§

fn can_convert_from(_value: &Expr<Point>) -> bool

source§

impl ConvertFrom<Expr<Point>> for Point

source§

fn convert_from(value: Expr<Point>, _context: &CompileContext) -> Expr<Self>

Errors Read more
source§

fn can_convert_from(_value: &Expr<Point>) -> bool

source§

impl ConvertFrom<Expr<Point>> for PointCollection

source§

fn convert_from(value: Expr<Point>, _context: &CompileContext) -> Expr<Self>

Errors Read more
source§

fn can_convert_from(_value: &Expr<Point>) -> bool

source§

impl ConvertFrom<Expr<Point>> for Scalar

source§

fn convert_from(value: Expr<Point>, context: &CompileContext) -> Expr<Self>

Errors Read more
source§

fn can_convert_from(_value: &Expr<Point>) -> bool

source§

impl ConvertFrom<Expr<PointCollection>> for Bundle

source§

impl ConvertFrom<Expr<PointCollection>> for Circle

source§

impl ConvertFrom<Expr<PointCollection>> for Line

source§

impl ConvertFrom<Expr<PointCollection>> for Point

source§

impl ConvertFrom<Expr<PointCollection>> for PointCollection

source§

impl ConvertFrom<Expr<PointCollection>> for Scalar

source§

impl ConvertFrom<Expr<Scalar>> for Bundle

source§

impl ConvertFrom<Expr<Scalar>> for Circle

source§

impl ConvertFrom<Expr<Scalar>> for Line

source§

impl ConvertFrom<Expr<Scalar>> for Point

source§

impl ConvertFrom<Expr<Scalar>> for PointCollection

source§

impl ConvertFrom<Expr<Scalar>> for Scalar

source§

fn convert_from(value: Expr<Scalar>, _context: &CompileContext) -> Expr<Self>

Errors Read more
source§

fn can_convert_from(_value: &Expr<Scalar>) -> bool

source§

impl ConvertFrom<Expr<Unknown>> for Bundle

source§

impl ConvertFrom<Expr<Unknown>> for Circle

source§

impl ConvertFrom<Expr<Unknown>> for Line

source§

impl ConvertFrom<Expr<Unknown>> for Point

source§

impl ConvertFrom<Expr<Unknown>> for PointCollection

source§

impl ConvertFrom<Expr<Unknown>> for Scalar

source§

impl<T: Debug + ?Sized + Displayed> Debug for Expr<T>
where T::Node: Debug,

source§

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

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

impl<T: Definition + Displayed> Definition for Expr<T>

source§

fn order(&self, context: &CompileContext) -> usize

Get the complexity order (how much adjustment is done to this entity).
source§

fn contains_entity(&self, entity: usize, context: &CompileContext) -> bool

Check if the object contains an entity
source§

impl<T: Display + Displayed> Display for Expr<T>

source§

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

Formats the value using the given formatter. Read more
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.
source§

impl<T: GetValueType + Displayed> GetValueType for Expr<T>

source§

impl Simplify for Expr<Circle>

source§

fn simplify(&self, context: &CompileContext) -> Self

Simlpifies the expression. WARNING: DOES NOT PRESERVE NODE.
source§

impl Simplify for Expr<Line>

source§

fn simplify(&self, context: &CompileContext) -> Expr<Line>

Simlpifies the expression. WARNING: DOES NOT PRESERVE NODE.
source§

impl Simplify for Expr<Point>

source§

fn simplify(&self, context: &CompileContext) -> Expr<Point>

Simlpifies the expression. WARNING: DOES NOT PRESERVE NODE.

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for Expr<T>

§

impl<T> !Send for Expr<T>

§

impl<T> !Sync for Expr<T>

§

impl<T> Unpin for Expr<T>

§

impl<T> !UnwindSafe for Expr<T>

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

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

§

fn vzip(self) -> V