Enum fj_kernel::partial::MaybePartial
source · pub enum MaybePartial<T: HasPartial> {
Full(Handle<T>),
Partial(T::Partial),
}Expand description
Can be used everywhere either a partial or full objects are accepted
Some convenience methods are available for specific instances of
MaybePartial (like, MaybePartial<Curve>, or MaybePartial<Vertex>).
Implementation Note
The set of available convenience methods is far from complete. Please feel free to just add more, if you need them.
Variants
Implementations
sourceimpl<T: HasPartial> MaybePartial<T>
impl<T: HasPartial> MaybePartial<T>
sourcepub fn is_partial(&self) -> bool
pub fn is_partial(&self) -> bool
Indicate whether this is a partial object
sourcepub fn update_partial(self, f: impl FnOnce(T::Partial) -> T::Partial) -> Self
pub fn update_partial(self, f: impl FnOnce(T::Partial) -> T::Partial) -> Self
If this is a partial object, update it
This is useful whenever a partial object can infer something about its parts from other parts, and wants to update what was inferred, in case it can be updated.
sourcepub fn into_full(self, objects: &Objects) -> Result<Handle<T>, ValidationError>where
T: Insert,
ValidationError: From<<T as Validate>::Error>,
pub fn into_full(self, objects: &Objects) -> Result<Handle<T>, ValidationError>where
T: Insert,
ValidationError: From<<T as Validate>::Error>,
Return or build a full object
If this already is a full object, it is returned. If this is a partial
object, the full object is built from it, using Partial::build.
sourcepub fn into_partial(self) -> T::Partial
pub fn into_partial(self) -> T::Partial
Return or convert a partial object
If this already is a partial object, is is returned. If this is a full
object, it is converted into a partial object using
HasPartial::to_partial.
sourceimpl MaybePartial<Curve>
impl MaybePartial<Curve>
sourcepub fn path(&self) -> Option<SurfacePath>
pub fn path(&self) -> Option<SurfacePath>
Access the path
sourcepub fn global_form(&self) -> MaybePartial<GlobalCurve>
pub fn global_form(&self) -> MaybePartial<GlobalCurve>
Access the global form
sourceimpl MaybePartial<GlobalEdge>
impl MaybePartial<GlobalEdge>
sourcepub fn curve(&self) -> MaybePartial<GlobalCurve>
pub fn curve(&self) -> MaybePartial<GlobalCurve>
Access the curve
sourcepub fn vertices(&self) -> [MaybePartial<GlobalVertex>; 2]
pub fn vertices(&self) -> [MaybePartial<GlobalVertex>; 2]
Access the vertices
sourceimpl MaybePartial<HalfEdge>
impl MaybePartial<HalfEdge>
sourcepub fn curve(&self) -> MaybePartial<Curve>
pub fn curve(&self) -> MaybePartial<Curve>
Access the curve
sourcepub fn front(&self) -> MaybePartial<Vertex>
pub fn front(&self) -> MaybePartial<Vertex>
Access the front vertex
sourcepub fn vertices(&self) -> [MaybePartial<Vertex>; 2]
pub fn vertices(&self) -> [MaybePartial<Vertex>; 2]
Access the vertices
sourceimpl MaybePartial<Surface>
impl MaybePartial<Surface>
sourcepub fn geometry(&self) -> Option<SurfaceGeometry>
pub fn geometry(&self) -> Option<SurfaceGeometry>
Access the geometry
sourceimpl MaybePartial<SurfaceVertex>
impl MaybePartial<SurfaceVertex>
sourcepub fn global_form(&self) -> MaybePartial<GlobalVertex>
pub fn global_form(&self) -> MaybePartial<GlobalVertex>
Access the global form
sourceimpl MaybePartial<Vertex>
impl MaybePartial<Vertex>
sourcepub fn surface_form(&self) -> MaybePartial<SurfaceVertex>
pub fn surface_form(&self) -> MaybePartial<SurfaceVertex>
Access the surface form
Trait Implementations
sourceimpl<T: Clone + HasPartial> Clone for MaybePartial<T>where
T::Partial: Clone,
impl<T: Clone + HasPartial> Clone for MaybePartial<T>where
T::Partial: Clone,
sourcefn clone(&self) -> MaybePartial<T>
fn clone(&self) -> MaybePartial<T>
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresourceimpl<T: Debug + HasPartial> Debug for MaybePartial<T>where
T::Partial: Debug,
impl<T: Debug + HasPartial> Debug for MaybePartial<T>where
T::Partial: Debug,
sourceimpl<T> Default for MaybePartial<T>where
T: HasPartial,
T::Partial: Default,
impl<T> Default for MaybePartial<T>where
T: HasPartial,
T::Partial: Default,
sourceimpl<T> From<Handle<T>> for MaybePartial<T>where
T: HasPartial,
impl<T> From<Handle<T>> for MaybePartial<T>where
T: HasPartial,
sourceimpl From<PartialCurve> for MaybePartial<Curve>
impl From<PartialCurve> for MaybePartial<Curve>
sourcefn from(partial: PartialCurve) -> Self
fn from(partial: PartialCurve) -> Self
sourceimpl From<PartialCycle> for MaybePartial<Cycle>
impl From<PartialCycle> for MaybePartial<Cycle>
sourcefn from(partial: PartialCycle) -> Self
fn from(partial: PartialCycle) -> Self
sourceimpl From<PartialFace> for MaybePartial<Face>
impl From<PartialFace> for MaybePartial<Face>
sourcefn from(partial: PartialFace) -> Self
fn from(partial: PartialFace) -> Self
sourceimpl From<PartialGlobalCurve> for MaybePartial<GlobalCurve>
impl From<PartialGlobalCurve> for MaybePartial<GlobalCurve>
sourcefn from(partial: PartialGlobalCurve) -> Self
fn from(partial: PartialGlobalCurve) -> Self
sourceimpl From<PartialGlobalEdge> for MaybePartial<GlobalEdge>
impl From<PartialGlobalEdge> for MaybePartial<GlobalEdge>
sourcefn from(partial: PartialGlobalEdge) -> Self
fn from(partial: PartialGlobalEdge) -> Self
sourceimpl From<PartialGlobalVertex> for MaybePartial<GlobalVertex>
impl From<PartialGlobalVertex> for MaybePartial<GlobalVertex>
sourcefn from(partial: PartialGlobalVertex) -> Self
fn from(partial: PartialGlobalVertex) -> Self
sourceimpl From<PartialHalfEdge> for MaybePartial<HalfEdge>
impl From<PartialHalfEdge> for MaybePartial<HalfEdge>
sourcefn from(partial: PartialHalfEdge) -> Self
fn from(partial: PartialHalfEdge) -> Self
sourceimpl From<PartialSurface> for MaybePartial<Surface>
impl From<PartialSurface> for MaybePartial<Surface>
sourcefn from(partial: PartialSurface) -> Self
fn from(partial: PartialSurface) -> Self
sourceimpl From<PartialSurfaceVertex> for MaybePartial<SurfaceVertex>
impl From<PartialSurfaceVertex> for MaybePartial<SurfaceVertex>
sourcefn from(partial: PartialSurfaceVertex) -> Self
fn from(partial: PartialSurfaceVertex) -> Self
sourceimpl From<PartialVertex> for MaybePartial<Vertex>
impl From<PartialVertex> for MaybePartial<Vertex>
sourcefn from(partial: PartialVertex) -> Self
fn from(partial: PartialVertex) -> Self
sourceimpl<T: Hash + HasPartial> Hash for MaybePartial<T>where
T::Partial: Hash,
impl<T: Hash + HasPartial> Hash for MaybePartial<T>where
T::Partial: Hash,
sourceimpl<T> MergeWith for MaybePartial<T>where
T: HasPartial,
T::Partial: MergeWith,
impl<T> MergeWith for MaybePartial<T>where
T: HasPartial,
T::Partial: MergeWith,
sourcefn merge_with(self, other: impl Into<Self>) -> Self
fn merge_with(self, other: impl Into<Self>) -> Self
sourceimpl<T: Ord + HasPartial> Ord for MaybePartial<T>where
T::Partial: Ord,
impl<T: Ord + HasPartial> Ord for MaybePartial<T>where
T::Partial: Ord,
sourcefn cmp(&self, other: &MaybePartial<T>) -> Ordering
fn cmp(&self, other: &MaybePartial<T>) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
sourceimpl<T: PartialEq + HasPartial> PartialEq<MaybePartial<T>> for MaybePartial<T>where
T::Partial: PartialEq,
impl<T: PartialEq + HasPartial> PartialEq<MaybePartial<T>> for MaybePartial<T>where
T::Partial: PartialEq,
sourcefn eq(&self, other: &MaybePartial<T>) -> bool
fn eq(&self, other: &MaybePartial<T>) -> bool
sourceimpl<T: PartialOrd + HasPartial> PartialOrd<MaybePartial<T>> for MaybePartial<T>where
T::Partial: PartialOrd,
impl<T: PartialOrd + HasPartial> PartialOrd<MaybePartial<T>> for MaybePartial<T>where
T::Partial: PartialOrd,
sourcefn partial_cmp(&self, other: &MaybePartial<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &MaybePartial<T>) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moresourceimpl<T, R> Replace<R> for MaybePartial<T>where
T: HasPartial + Get<R>,
T::Partial: Replace<R>,
impl<T, R> Replace<R> for MaybePartial<T>where
T: HasPartial + Get<R>,
T::Partial: Replace<R>,
sourceimpl<T> TransformObject for MaybePartial<T>where
T: HasPartial,
Handle<T>: TransformObject,
T::Partial: TransformObject,
impl<T> TransformObject for MaybePartial<T>where
T: HasPartial,
Handle<T>: TransformObject,
T::Partial: TransformObject,
impl<T: Eq + HasPartial> Eq for MaybePartial<T>where
T::Partial: Eq,
impl<T: HasPartial> StructuralEq for MaybePartial<T>
impl<T: HasPartial> StructuralPartialEq for MaybePartial<T>
Auto Trait Implementations
impl<T> !RefUnwindSafe for MaybePartial<T>
impl<T> Send for MaybePartial<T>where
<T as HasPartial>::Partial: Send,
impl<T> Sync for MaybePartial<T>where
<T as HasPartial>::Partial: Sync,
impl<T> Unpin for MaybePartial<T>where
<T as HasPartial>::Partial: Unpin,
impl<T> !UnwindSafe for MaybePartial<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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. Read morefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read morefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s. Read morefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s. Read moreimpl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read morefn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.