Enum fj_kernel::partial::MaybePartial
source · [−]pub enum MaybePartial<T: HasPartialForm> {
Full(T),
Partial(T::PartialForm),
}Expand description
Either a partial object or a full one
Variants
Full(T)
A full object
Partial(T::PartialForm)
A partial object
Implementations
sourceimpl<T: HasPartialForm> MaybePartial<T>
impl<T: HasPartialForm> MaybePartial<T>
sourcepub fn into_full(self, stores: &Stores) -> T
pub fn into_full(self, stores: &Stores) -> T
Return the full object, either directly or by building it
sourcepub fn into_partial(self) -> T::PartialForm
pub fn into_partial(self) -> T::PartialForm
Return the partial object, either directly or via conversion
Trait Implementations
sourceimpl<T: Clone + HasPartialForm> Clone for MaybePartial<T>where
T::PartialForm: Clone,
impl<T: Clone + HasPartialForm> Clone for MaybePartial<T>where
T::PartialForm: Clone,
sourcefn clone(&self) -> MaybePartial<T>
fn clone(&self) -> MaybePartial<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl<T: Debug + HasPartialForm> Debug for MaybePartial<T>where
T::PartialForm: Debug,
impl<T: Debug + HasPartialForm> Debug for MaybePartial<T>where
T::PartialForm: Debug,
sourceimpl From<Curve> for MaybePartial<Curve>
impl From<Curve> for MaybePartial<Curve>
sourceimpl From<GlobalEdge> for MaybePartial<GlobalEdge>
impl From<GlobalEdge> for MaybePartial<GlobalEdge>
sourcefn from(full: GlobalEdge) -> Self
fn from(full: GlobalEdge) -> Self
Converts to this type from the input type.
sourceimpl From<GlobalVertex> for MaybePartial<GlobalVertex>
impl From<GlobalVertex> for MaybePartial<GlobalVertex>
sourcefn from(full: GlobalVertex) -> Self
fn from(full: GlobalVertex) -> Self
Converts to this type from the input type.
sourceimpl From<HalfEdge> for MaybePartial<HalfEdge>
impl From<HalfEdge> for MaybePartial<HalfEdge>
sourceimpl From<Handle<GlobalCurve>> for MaybePartial<Handle<GlobalCurve>>
impl From<Handle<GlobalCurve>> for MaybePartial<Handle<GlobalCurve>>
sourcefn from(full: Handle<GlobalCurve>) -> Self
fn from(full: Handle<GlobalCurve>) -> Self
Converts to this type from the input type.
sourceimpl From<PartialCurve> for MaybePartial<Curve>
impl From<PartialCurve> for MaybePartial<Curve>
sourcefn from(partial: PartialCurve) -> Self
fn from(partial: PartialCurve) -> Self
Converts to this type from the input type.
sourceimpl From<PartialGlobalCurve> for MaybePartial<Handle<GlobalCurve>>
impl From<PartialGlobalCurve> for MaybePartial<Handle<GlobalCurve>>
sourcefn from(partial: PartialGlobalCurve) -> Self
fn from(partial: PartialGlobalCurve) -> Self
Converts to this type from the input type.
sourceimpl From<PartialGlobalEdge> for MaybePartial<GlobalEdge>
impl From<PartialGlobalEdge> for MaybePartial<GlobalEdge>
sourcefn from(partial: PartialGlobalEdge) -> Self
fn from(partial: PartialGlobalEdge) -> Self
Converts to this type from the input type.
sourceimpl From<PartialGlobalVertex> for MaybePartial<GlobalVertex>
impl From<PartialGlobalVertex> for MaybePartial<GlobalVertex>
sourcefn from(partial: PartialGlobalVertex) -> Self
fn from(partial: PartialGlobalVertex) -> Self
Converts to this type from the input type.
sourceimpl From<PartialHalfEdge> for MaybePartial<HalfEdge>
impl From<PartialHalfEdge> for MaybePartial<HalfEdge>
sourcefn from(partial: PartialHalfEdge) -> Self
fn from(partial: PartialHalfEdge) -> Self
Converts to this type from the input type.
sourceimpl From<PartialSurfaceVertex> for MaybePartial<SurfaceVertex>
impl From<PartialSurfaceVertex> for MaybePartial<SurfaceVertex>
sourcefn from(partial: PartialSurfaceVertex) -> Self
fn from(partial: PartialSurfaceVertex) -> Self
Converts to this type from the input type.
sourceimpl From<PartialVertex> for MaybePartial<Vertex>
impl From<PartialVertex> for MaybePartial<Vertex>
sourcefn from(partial: PartialVertex) -> Self
fn from(partial: PartialVertex) -> Self
Converts to this type from the input type.
sourceimpl From<SurfaceVertex> for MaybePartial<SurfaceVertex>
impl From<SurfaceVertex> for MaybePartial<SurfaceVertex>
sourcefn from(full: SurfaceVertex) -> Self
fn from(full: SurfaceVertex) -> Self
Converts to this type from the input type.
sourceimpl From<Vertex> for MaybePartial<Vertex>
impl From<Vertex> for MaybePartial<Vertex>
sourceimpl<T: Hash + HasPartialForm> Hash for MaybePartial<T>where
T::PartialForm: Hash,
impl<T: Hash + HasPartialForm> Hash for MaybePartial<T>where
T::PartialForm: Hash,
sourceimpl<T: Ord + HasPartialForm> Ord for MaybePartial<T>where
T::PartialForm: Ord,
impl<T: Ord + HasPartialForm> Ord for MaybePartial<T>where
T::PartialForm: Ord,
sourcefn cmp(&self, other: &MaybePartial<T>) -> Ordering
fn cmp(&self, other: &MaybePartial<T>) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<T: PartialEq + HasPartialForm> PartialEq<MaybePartial<T>> for MaybePartial<T>where
T::PartialForm: PartialEq,
impl<T: PartialEq + HasPartialForm> PartialEq<MaybePartial<T>> for MaybePartial<T>where
T::PartialForm: PartialEq,
sourcefn eq(&self, other: &MaybePartial<T>) -> bool
fn eq(&self, other: &MaybePartial<T>) -> bool
sourceimpl<T: PartialOrd + HasPartialForm> PartialOrd<MaybePartial<T>> for MaybePartial<T>where
T::PartialForm: PartialOrd,
impl<T: PartialOrd + HasPartialForm> PartialOrd<MaybePartial<T>> for MaybePartial<T>where
T::PartialForm: 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
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl<T: Copy + HasPartialForm> Copy for MaybePartial<T>where
T::PartialForm: Copy,
impl<T: Eq + HasPartialForm> Eq for MaybePartial<T>where
T::PartialForm: Eq,
impl<T: HasPartialForm> StructuralEq for MaybePartial<T>
impl<T: HasPartialForm> StructuralPartialEq for MaybePartial<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for MaybePartial<T>where
T: RefUnwindSafe,
<T as HasPartialForm>::PartialForm: RefUnwindSafe,
impl<T> Send for MaybePartial<T>where
T: Send,
<T as HasPartialForm>::PartialForm: Send,
impl<T> Sync for MaybePartial<T>where
T: Sync,
<T as HasPartialForm>::PartialForm: Sync,
impl<T> Unpin for MaybePartial<T>where
T: Unpin,
<T as HasPartialForm>::PartialForm: Unpin,
impl<T> UnwindSafe for MaybePartial<T>where
T: UnwindSafe,
<T as HasPartialForm>::PartialForm: UnwindSafe,
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
Mutably borrows from an owned value. Read more
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>
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. Read morefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
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)
Convert
&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)
Convert
&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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read morefn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.