pub enum AnyObject<F: Form> {
    Curve(F::Form<Curve>),
    Cycle(F::Form<Cycle>),
    Face(F::Form<Face>),
    HalfEdge(F::Form<HalfEdge>),
    Region(F::Form<Region>),
    Shell(F::Form<Shell>),
    Sketch(F::Form<Sketch>),
    Solid(F::Form<Solid>),
    Surface(F::Form<Surface>),
    Vertex(F::Form<Vertex>),
}
Expand description

An enum that can hold any object

This enum is generic over the form that the object takes. An AnyObject<Bare> contains a bare objects, for example Curve. An AnyObject<Stored> contains a handle referencing a stored object, for example Handle<Curve>.

Variants§

§

Curve(F::Form<Curve>)

A curve

§

Cycle(F::Form<Cycle>)

A cycle

§

Face(F::Form<Face>)

A face

§

HalfEdge(F::Form<HalfEdge>)

A half-edge

§

Region(F::Form<Region>)

A region

§

Shell(F::Form<Shell>)

A shell

§

Sketch(F::Form<Sketch>)

A sketch

§

Solid(F::Form<Solid>)

A solid

§

Surface(F::Form<Surface>)

A surface

§

Vertex(F::Form<Vertex>)

A vertex

Implementations§

source§

impl AnyObject<Stored>

source

pub fn id(&self) -> ObjectId

Access the ID of the object

source

pub fn validate( &self, config: &ValidationConfig, errors: &mut Vec<ValidationError>, geometry: &Geometry )

Validate the object with a pre-defined validation configuration

source§

impl AnyObject<AboutToBeStored>

source

pub fn insert(self, objects: &mut Objects) -> AnyObject<Stored>

Insert the object into its respective store

Trait Implementations§

source§

impl<F: Clone + Form> Clone for AnyObject<F>

source§

fn clone(&self) -> AnyObject<F>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<F: Debug + Form> Debug for AnyObject<F>

source§

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

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

impl From<(Handle<Curve>, Curve)> for AnyObject<AboutToBeStored>

source§

fn from((handle, object): (Handle<Curve>, Curve)) -> Self

Converts to this type from the input type.
source§

impl From<(Handle<Cycle>, Cycle)> for AnyObject<AboutToBeStored>

source§

fn from((handle, object): (Handle<Cycle>, Cycle)) -> Self

Converts to this type from the input type.
source§

impl From<(Handle<Face>, Face)> for AnyObject<AboutToBeStored>

source§

fn from((handle, object): (Handle<Face>, Face)) -> Self

Converts to this type from the input type.
source§

impl From<(Handle<HalfEdge>, HalfEdge)> for AnyObject<AboutToBeStored>

source§

fn from((handle, object): (Handle<HalfEdge>, HalfEdge)) -> Self

Converts to this type from the input type.
source§

impl From<(Handle<Region>, Region)> for AnyObject<AboutToBeStored>

source§

fn from((handle, object): (Handle<Region>, Region)) -> Self

Converts to this type from the input type.
source§

impl From<(Handle<Shell>, Shell)> for AnyObject<AboutToBeStored>

source§

fn from((handle, object): (Handle<Shell>, Shell)) -> Self

Converts to this type from the input type.
source§

impl From<(Handle<Sketch>, Sketch)> for AnyObject<AboutToBeStored>

source§

fn from((handle, object): (Handle<Sketch>, Sketch)) -> Self

Converts to this type from the input type.
source§

impl From<(Handle<Solid>, Solid)> for AnyObject<AboutToBeStored>

source§

fn from((handle, object): (Handle<Solid>, Solid)) -> Self

Converts to this type from the input type.
source§

impl From<(Handle<Surface>, Surface)> for AnyObject<AboutToBeStored>

source§

fn from((handle, object): (Handle<Surface>, Surface)) -> Self

Converts to this type from the input type.
source§

impl From<(Handle<Vertex>, Vertex)> for AnyObject<AboutToBeStored>

source§

fn from((handle, object): (Handle<Vertex>, Vertex)) -> Self

Converts to this type from the input type.
source§

impl From<AnyObject<AboutToBeStored>> for AnyObject<Stored>

source§

fn from(object: AnyObject<AboutToBeStored>) -> Self

Converts to this type from the input type.
source§

impl From<Curve> for AnyObject<Bare>

source§

fn from(object: Curve) -> Self

Converts to this type from the input type.
source§

impl From<Cycle> for AnyObject<Bare>

source§

fn from(object: Cycle) -> Self

Converts to this type from the input type.
source§

impl From<Face> for AnyObject<Bare>

source§

fn from(object: Face) -> Self

Converts to this type from the input type.
source§

impl From<HalfEdge> for AnyObject<Bare>

source§

fn from(object: HalfEdge) -> Self

Converts to this type from the input type.
source§

impl From<Handle<Curve>> for AnyObject<Stored>

source§

fn from(object: Handle<Curve>) -> Self

Converts to this type from the input type.
source§

impl From<Handle<Cycle>> for AnyObject<Stored>

source§

fn from(object: Handle<Cycle>) -> Self

Converts to this type from the input type.
source§

impl From<Handle<Face>> for AnyObject<Stored>

source§

fn from(object: Handle<Face>) -> Self

Converts to this type from the input type.
source§

impl From<Handle<HalfEdge>> for AnyObject<Stored>

source§

fn from(object: Handle<HalfEdge>) -> Self

Converts to this type from the input type.
source§

impl From<Handle<Region>> for AnyObject<Stored>

source§

fn from(object: Handle<Region>) -> Self

Converts to this type from the input type.
source§

impl From<Handle<Shell>> for AnyObject<Stored>

source§

fn from(object: Handle<Shell>) -> Self

Converts to this type from the input type.
source§

impl From<Handle<Sketch>> for AnyObject<Stored>

source§

fn from(object: Handle<Sketch>) -> Self

Converts to this type from the input type.
source§

impl From<Handle<Solid>> for AnyObject<Stored>

source§

fn from(object: Handle<Solid>) -> Self

Converts to this type from the input type.
source§

impl From<Handle<Surface>> for AnyObject<Stored>

source§

fn from(object: Handle<Surface>) -> Self

Converts to this type from the input type.
source§

impl From<Handle<Vertex>> for AnyObject<Stored>

source§

fn from(object: Handle<Vertex>) -> Self

Converts to this type from the input type.
source§

impl From<Region> for AnyObject<Bare>

source§

fn from(object: Region) -> Self

Converts to this type from the input type.
source§

impl From<Shell> for AnyObject<Bare>

source§

fn from(object: Shell) -> Self

Converts to this type from the input type.
source§

impl From<Sketch> for AnyObject<Bare>

source§

fn from(object: Sketch) -> Self

Converts to this type from the input type.
source§

impl From<Solid> for AnyObject<Bare>

source§

fn from(object: Solid) -> Self

Converts to this type from the input type.
source§

impl From<Surface> for AnyObject<Bare>

source§

fn from(object: Surface) -> Self

Converts to this type from the input type.
source§

impl From<Vertex> for AnyObject<Bare>

source§

fn from(object: Vertex) -> Self

Converts to this type from the input type.
source§

impl<F: Ord + Form> Ord for AnyObject<F>
where F::Form<Curve>: Ord, F::Form<Cycle>: Ord, F::Form<Face>: Ord, F::Form<HalfEdge>: Ord, F::Form<Region>: Ord, F::Form<Shell>: Ord, F::Form<Sketch>: Ord, F::Form<Solid>: Ord, F::Form<Surface>: Ord, F::Form<Vertex>: Ord,

source§

fn cmp(&self, other: &AnyObject<F>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl<F: PartialEq + Form> PartialEq for AnyObject<F>

source§

fn eq(&self, other: &AnyObject<F>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<F: PartialOrd + Form> PartialOrd for AnyObject<F>

source§

fn partial_cmp(&self, other: &AnyObject<F>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<F: Eq + Form> Eq for AnyObject<F>
where F::Form<Curve>: Eq, F::Form<Cycle>: Eq, F::Form<Face>: Eq, F::Form<HalfEdge>: Eq, F::Form<Region>: Eq, F::Form<Shell>: Eq, F::Form<Sketch>: Eq, F::Form<Solid>: Eq, F::Form<Surface>: Eq, F::Form<Vertex>: Eq,

source§

impl<F: Form> StructuralPartialEq for AnyObject<F>

Auto Trait Implementations§

§

impl<F> Freeze for AnyObject<F>
where <F as Form>::Form<Curve>: Freeze, <F as Form>::Form<Cycle>: Freeze, <F as Form>::Form<Face>: Freeze, <F as Form>::Form<HalfEdge>: Freeze, <F as Form>::Form<Region>: Freeze, <F as Form>::Form<Shell>: Freeze, <F as Form>::Form<Sketch>: Freeze, <F as Form>::Form<Solid>: Freeze, <F as Form>::Form<Surface>: Freeze, <F as Form>::Form<Vertex>: Freeze,

§

impl<F> RefUnwindSafe for AnyObject<F>

§

impl<F> Send for AnyObject<F>
where <F as Form>::Form<Curve>: Send, <F as Form>::Form<Cycle>: Send, <F as Form>::Form<Face>: Send, <F as Form>::Form<HalfEdge>: Send, <F as Form>::Form<Region>: Send, <F as Form>::Form<Shell>: Send, <F as Form>::Form<Sketch>: Send, <F as Form>::Form<Solid>: Send, <F as Form>::Form<Surface>: Send, <F as Form>::Form<Vertex>: Send,

§

impl<F> Sync for AnyObject<F>
where <F as Form>::Form<Curve>: Sync, <F as Form>::Form<Cycle>: Sync, <F as Form>::Form<Face>: Sync, <F as Form>::Form<HalfEdge>: Sync, <F as Form>::Form<Region>: Sync, <F as Form>::Form<Shell>: Sync, <F as Form>::Form<Sketch>: Sync, <F as Form>::Form<Solid>: Sync, <F as Form>::Form<Surface>: Sync, <F as Form>::Form<Vertex>: Sync,

§

impl<F> Unpin for AnyObject<F>
where <F as Form>::Form<Curve>: Unpin, <F as Form>::Form<Cycle>: Unpin, <F as Form>::Form<Face>: Unpin, <F as Form>::Form<HalfEdge>: Unpin, <F as Form>::Form<Region>: Unpin, <F as Form>::Form<Shell>: Unpin, <F as Form>::Form<Sketch>: Unpin, <F as Form>::Form<Solid>: Unpin, <F as Form>::Form<Surface>: Unpin, <F as Form>::Form<Vertex>: Unpin,

§

impl<F> UnwindSafe for AnyObject<F>

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> Downcast for T
where T: Any,

source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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> Same for T

§

type Output = T

Should always be Self
source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,