Struct ncollide2d::pipeline::world::CollisionWorld
source · [−]pub struct CollisionWorld<N: RealField + Copy, T> {
pub objects: CollisionObjectSlab<N, T>,
pub broad_phase: BroadPhaseObject<N>,
pub narrow_phase: NarrowPhase<N, CollisionObjectSlabHandle>,
pub toi_dispatcher: Box<dyn TOIDispatcher<N>>,
pub interactions: InteractionGraph<N, CollisionObjectSlabHandle>,
pub pair_filters: Option<Box<dyn BroadPhasePairFilter<N, CollisionObjectSlab<N, T>>>>,
}
Expand description
A world that handles collision objects.
Fields
objects: CollisionObjectSlab<N, T>
The set of objects on this collision world.
broad_phase: BroadPhaseObject<N>
The broad phase used by this collision world.
narrow_phase: NarrowPhase<N, CollisionObjectSlabHandle>
The narrow-phase used by this collision world.
toi_dispatcher: Box<dyn TOIDispatcher<N>>
The Time of Impact dispatcher used.
interactions: InteractionGraph<N, CollisionObjectSlabHandle>
The graph of interactions detected so far.
pair_filters: Option<Box<dyn BroadPhasePairFilter<N, CollisionObjectSlab<N, T>>>>
A user-defined broad-phase pair filter.
Implementations
sourceimpl<N: RealField + Copy, T> CollisionWorld<N, T>
impl<N: RealField + Copy, T> CollisionWorld<N, T>
sourcepub fn new(margin: N) -> CollisionWorld<N, T>
pub fn new(margin: N) -> CollisionWorld<N, T>
Creates a new collision world.
sourcepub fn add(
&mut self,
position: Isometry<N>,
shape: ShapeHandle<N>,
collision_groups: CollisionGroups,
query_type: GeometricQueryType<N>,
data: T
) -> (CollisionObjectSlabHandle, &mut CollisionObject<N, T>)
pub fn add(
&mut self,
position: Isometry<N>,
shape: ShapeHandle<N>,
collision_groups: CollisionGroups,
query_type: GeometricQueryType<N>,
data: T
) -> (CollisionObjectSlabHandle, &mut CollisionObject<N, T>)
Adds a collision object to the world.
sourcepub fn update(&mut self)
pub fn update(&mut self)
Updates the collision world.
This executes the whole collision detection pipeline:
- Clears the event pools.
- Executes the broad phase first.
- Executes the narrow phase.
sourcepub fn clear_events(&mut self)
pub fn clear_events(&mut self)
Empty the contact and proximity event pools.
sourcepub fn remove(&mut self, handles: &[CollisionObjectSlabHandle])
pub fn remove(&mut self, handles: &[CollisionObjectSlabHandle])
Removed the specified set of collision objects from the world.
Panics of any handle is invalid, or if the list contains duplicates.
sourcepub fn set_position(
&mut self,
handle: CollisionObjectSlabHandle,
pos: Isometry<N>
)
👎 Deprecated: Call directly the method .set_position
on the collision object.
pub fn set_position(
&mut self,
handle: CollisionObjectSlabHandle,
pos: Isometry<N>
)
Call directly the method .set_position
on the collision object.
Sets the position of the collision object attached to the specified object.
sourcepub fn set_query_type(
&mut self,
handle: CollisionObjectSlabHandle,
query_type: GeometricQueryType<N>
)
👎 Deprecated: Call directly the method .set_query_type
on the collision object.
pub fn set_query_type(
&mut self,
handle: CollisionObjectSlabHandle,
query_type: GeometricQueryType<N>
)
Call directly the method .set_query_type
on the collision object.
Sets the GeometricQueryType
of the collision object.
sourcepub fn set_shape(
&mut self,
handle: CollisionObjectSlabHandle,
shape: ShapeHandle<N>
)
👎 Deprecated: Call directly the method .set_shape
on the collision object.
pub fn set_shape(
&mut self,
handle: CollisionObjectSlabHandle,
shape: ShapeHandle<N>
)
Call directly the method .set_shape
on the collision object.
Sets the shape of the given collision object.
sourcepub fn set_deformations(
&mut self,
handle: CollisionObjectSlabHandle,
coords: &[N]
)
👎 Deprecated: Call directly the method .set_deformations
on the collision object.
pub fn set_deformations(
&mut self,
handle: CollisionObjectSlabHandle,
coords: &[N]
)
Call directly the method .set_deformations
on the collision object.
Apply the given deformations to the specified object.
sourcepub fn set_broad_phase_pair_filter<F>(&mut self, filter: Option<F>) where
F: BroadPhasePairFilter<N, CollisionObjectSlab<N, T>> + 'static,
pub fn set_broad_phase_pair_filter<F>(&mut self, filter: Option<F>) where
F: BroadPhasePairFilter<N, CollisionObjectSlab<N, T>> + 'static,
Sets the user-defined filter that tells if a potential collision pair should be ignored or not.
The proximity filter returns false
for a given pair of collision objects if they should
be ignored by the narrow phase. Keep in mind that modifying the proximity filter will have
a non-trivial overhead during the next update as it will force re-detection of all
collision pairs.
sourcepub fn perform_broad_phase(&mut self)
pub fn perform_broad_phase(&mut self)
Executes the broad phase of the collision detection pipeline.
sourcepub fn perform_narrow_phase(&mut self)
pub fn perform_narrow_phase(&mut self)
Executes the narrow phase of the collision detection pipeline.
sourcepub fn broad_phase_aabb(
&self,
handle: CollisionObjectSlabHandle
) -> Option<&AABB<N>>
pub fn broad_phase_aabb(
&self,
handle: CollisionObjectSlabHandle
) -> Option<&AABB<N>>
The broad-phase aabb for the given collision object.
sourcepub fn collision_objects(&self) -> CollisionObjects<'_, N, T>ⓘNotable traits for CollisionObjects<'a, N, T>impl<'a, N: 'a + RealField + Copy, T: 'a> Iterator for CollisionObjects<'a, N, T> type Item = (CollisionObjectSlabHandle, &'a CollisionObject<N, T>);
pub fn collision_objects(&self) -> CollisionObjects<'_, N, T>ⓘNotable traits for CollisionObjects<'a, N, T>impl<'a, N: 'a + RealField + Copy, T: 'a> Iterator for CollisionObjects<'a, N, T> type Item = (CollisionObjectSlabHandle, &'a CollisionObject<N, T>);
Iterates through all collision objects.
sourcepub fn collision_object(
&self,
handle: CollisionObjectSlabHandle
) -> Option<&CollisionObject<N, T>>
pub fn collision_object(
&self,
handle: CollisionObjectSlabHandle
) -> Option<&CollisionObject<N, T>>
Returns a reference to the collision object identified by its handle.
sourcepub fn get_mut(
&mut self,
handle: CollisionObjectSlabHandle
) -> Option<&mut CollisionObject<N, T>>
pub fn get_mut(
&mut self,
handle: CollisionObjectSlabHandle
) -> Option<&mut CollisionObject<N, T>>
Returns a mutable reference to the collision object identified by its handle.
sourcepub fn collision_object_pair_mut(
&mut self,
handle1: CollisionObjectSlabHandle,
handle2: CollisionObjectSlabHandle
) -> (Option<&mut CollisionObject<N, T>>, Option<&mut CollisionObject<N, T>>)
pub fn collision_object_pair_mut(
&mut self,
handle1: CollisionObjectSlabHandle,
handle2: CollisionObjectSlabHandle
) -> (Option<&mut CollisionObject<N, T>>, Option<&mut CollisionObject<N, T>>)
Returns a mutable reference to a pair collision object identified by their handles.
Panics if both handles are equal.
sourcepub fn set_collision_groups(
&mut self,
handle: CollisionObjectSlabHandle,
groups: CollisionGroups
)
👎 Deprecated: Call directly the method .set_collision_groups
on the collision object.
pub fn set_collision_groups(
&mut self,
handle: CollisionObjectSlabHandle,
groups: CollisionGroups
)
Call directly the method .set_collision_groups
on the collision object.
Sets the collision groups of the given collision object.
sourcepub fn sweep_test<'a>(
&'a self,
shape: &'a dyn Shape<N>,
isometry: &'a Isometry<N>,
direction: &'a Unit<Vector<N>>,
maximum_distance: N,
groups: &'a CollisionGroups
) -> impl Iterator<Item = (CollisionObjectSlabHandle, TOI<N>)> + 'a
pub fn sweep_test<'a>(
&'a self,
shape: &'a dyn Shape<N>,
isometry: &'a Isometry<N>,
direction: &'a Unit<Vector<N>>,
maximum_distance: N,
groups: &'a CollisionGroups
) -> impl Iterator<Item = (CollisionObjectSlabHandle, TOI<N>)> + 'a
Returns all objects in the collision world that intersect with the shape
transformed by isometry
along direction
until maximum_distance
is
reached. The objects are not returned in any particular order. You may
use the toi
returned for each object to determine the closest object.
sourcepub fn interferences_with_ray<'a, 'b>(
&'a self,
ray: &'b Ray<N>,
max_toi: N,
groups: &'b CollisionGroups
) -> InterferencesWithRay<'a, 'b, N, CollisionObjectSlab<N, T>>ⓘNotable traits for InterferencesWithRay<'a, 'b, N, Objects>impl<'a, 'b, N: RealField + Copy, Objects> Iterator for InterferencesWithRay<'a, 'b, N, Objects> where
N: RealField + Copy,
Objects: CollisionObjectSet<N>, type Item = (Objects::CollisionObjectHandle, &'a Objects::CollisionObject, RayIntersection<N>);
pub fn interferences_with_ray<'a, 'b>(
&'a self,
ray: &'b Ray<N>,
max_toi: N,
groups: &'b CollisionGroups
) -> InterferencesWithRay<'a, 'b, N, CollisionObjectSlab<N, T>>ⓘNotable traits for InterferencesWithRay<'a, 'b, N, Objects>impl<'a, 'b, N: RealField + Copy, Objects> Iterator for InterferencesWithRay<'a, 'b, N, Objects> where
N: RealField + Copy,
Objects: CollisionObjectSet<N>, type Item = (Objects::CollisionObjectHandle, &'a Objects::CollisionObject, RayIntersection<N>);
N: RealField + Copy,
Objects: CollisionObjectSet<N>, type Item = (Objects::CollisionObjectHandle, &'a Objects::CollisionObject, RayIntersection<N>);
Computes the interferences between every rigid bodies on this world and a ray.
sourcepub fn first_interference_with_ray<'a, 'b>(
&'a self,
ray: &'b Ray<N>,
max_toi: N,
groups: &'b CollisionGroups
) -> Option<FirstInterferenceWithRay<'a, N, CollisionObjectSlab<N, T>>>
pub fn first_interference_with_ray<'a, 'b>(
&'a self,
ray: &'b Ray<N>,
max_toi: N,
groups: &'b CollisionGroups
) -> Option<FirstInterferenceWithRay<'a, N, CollisionObjectSlab<N, T>>>
Computes the first interference with ray
and
sourcepub fn interferences_with_point<'a, 'b>(
&'a self,
point: &'b Point<N>,
groups: &'b CollisionGroups
) -> InterferencesWithPoint<'a, 'b, N, CollisionObjectSlab<N, T>>ⓘNotable traits for InterferencesWithPoint<'a, 'b, N, Objects>impl<'a, 'b, N: RealField + Copy, Objects> Iterator for InterferencesWithPoint<'a, 'b, N, Objects> where
N: RealField + Copy,
Objects: CollisionObjectSet<N>, type Item = (Objects::CollisionObjectHandle, &'a Objects::CollisionObject);
pub fn interferences_with_point<'a, 'b>(
&'a self,
point: &'b Point<N>,
groups: &'b CollisionGroups
) -> InterferencesWithPoint<'a, 'b, N, CollisionObjectSlab<N, T>>ⓘNotable traits for InterferencesWithPoint<'a, 'b, N, Objects>impl<'a, 'b, N: RealField + Copy, Objects> Iterator for InterferencesWithPoint<'a, 'b, N, Objects> where
N: RealField + Copy,
Objects: CollisionObjectSet<N>, type Item = (Objects::CollisionObjectHandle, &'a Objects::CollisionObject);
N: RealField + Copy,
Objects: CollisionObjectSet<N>, type Item = (Objects::CollisionObjectHandle, &'a Objects::CollisionObject);
Computes the interferences between every rigid bodies of a given broad phase, and a point.
sourcepub fn interferences_with_aabb<'a, 'b>(
&'a self,
aabb: &'b AABB<N>,
groups: &'b CollisionGroups
) -> InterferencesWithAABB<'a, 'b, N, CollisionObjectSlab<N, T>>ⓘNotable traits for InterferencesWithAABB<'a, 'b, N, Objects>impl<'a, 'b, N: RealField + Copy, Objects: CollisionObjectSet<N>> Iterator for InterferencesWithAABB<'a, 'b, N, Objects> type Item = (Objects::CollisionObjectHandle, &'a Objects::CollisionObject);
pub fn interferences_with_aabb<'a, 'b>(
&'a self,
aabb: &'b AABB<N>,
groups: &'b CollisionGroups
) -> InterferencesWithAABB<'a, 'b, N, CollisionObjectSlab<N, T>>ⓘNotable traits for InterferencesWithAABB<'a, 'b, N, Objects>impl<'a, 'b, N: RealField + Copy, Objects: CollisionObjectSet<N>> Iterator for InterferencesWithAABB<'a, 'b, N, Objects> type Item = (Objects::CollisionObjectHandle, &'a Objects::CollisionObject);
Computes the interferences between every rigid bodies of a given broad phase, and a aabb.
sourcepub fn set_narrow_phase(
&mut self,
narrow_phase: NarrowPhase<N, CollisionObjectSlabHandle>
)
pub fn set_narrow_phase(
&mut self,
narrow_phase: NarrowPhase<N, CollisionObjectSlabHandle>
)
Customize the selection of narrowphase collision detection algorithms
sourcepub fn interaction_pairs(
&self,
effective_only: bool
) -> impl Iterator<Item = (CollisionObjectSlabHandle, CollisionObjectSlabHandle, &Interaction<N>)>
pub fn interaction_pairs(
&self,
effective_only: bool
) -> impl Iterator<Item = (CollisionObjectSlabHandle, CollisionObjectSlabHandle, &Interaction<N>)>
All the potential interactions pairs.
Refer to the official user guide for details.
sourcepub fn contact_pairs(
&self,
effective_only: bool
) -> impl Iterator<Item = (CollisionObjectSlabHandle, CollisionObjectSlabHandle, &ContactAlgorithm<N>, &ContactManifold<N>)>
pub fn contact_pairs(
&self,
effective_only: bool
) -> impl Iterator<Item = (CollisionObjectSlabHandle, CollisionObjectSlabHandle, &ContactAlgorithm<N>, &ContactManifold<N>)>
All the potential contact pairs.
Refer to the official user guide for details.
sourcepub fn proximity_pairs(
&self,
effective_only: bool
) -> impl Iterator<Item = (CollisionObjectSlabHandle, CollisionObjectSlabHandle, &dyn ProximityDetector<N>, Proximity)>
pub fn proximity_pairs(
&self,
effective_only: bool
) -> impl Iterator<Item = (CollisionObjectSlabHandle, CollisionObjectSlabHandle, &dyn ProximityDetector<N>, Proximity)>
All the potential proximity pairs.
Refer to the official user guide for details.
sourcepub fn interaction_pair(
&self,
handle1: CollisionObjectSlabHandle,
handle2: CollisionObjectSlabHandle,
effective_only: bool
) -> Option<(CollisionObjectSlabHandle, CollisionObjectSlabHandle, &Interaction<N>)>
pub fn interaction_pair(
&self,
handle1: CollisionObjectSlabHandle,
handle2: CollisionObjectSlabHandle,
effective_only: bool
) -> Option<(CollisionObjectSlabHandle, CollisionObjectSlabHandle, &Interaction<N>)>
The potential interaction pair between the two specified collision objects.
Refer to the official user guide for details.
sourcepub fn contact_pair(
&self,
handle1: CollisionObjectSlabHandle,
handle2: CollisionObjectSlabHandle,
effective_only: bool
) -> Option<(CollisionObjectSlabHandle, CollisionObjectSlabHandle, &ContactAlgorithm<N>, &ContactManifold<N>)>
pub fn contact_pair(
&self,
handle1: CollisionObjectSlabHandle,
handle2: CollisionObjectSlabHandle,
effective_only: bool
) -> Option<(CollisionObjectSlabHandle, CollisionObjectSlabHandle, &ContactAlgorithm<N>, &ContactManifold<N>)>
The potential contact pair between the two specified collision objects.
Refer to the official user guide for details.
sourcepub fn proximity_pair(
&self,
handle1: CollisionObjectSlabHandle,
handle2: CollisionObjectSlabHandle,
effective_only: bool
) -> Option<(CollisionObjectSlabHandle, CollisionObjectSlabHandle, &dyn ProximityDetector<N>, Proximity)>
pub fn proximity_pair(
&self,
handle1: CollisionObjectSlabHandle,
handle2: CollisionObjectSlabHandle,
effective_only: bool
) -> Option<(CollisionObjectSlabHandle, CollisionObjectSlabHandle, &dyn ProximityDetector<N>, Proximity)>
The potential proximity pair between the two specified collision objects.
Refer to the official user guide for details.
sourcepub fn interactions_with(
&self,
handle: CollisionObjectSlabHandle,
effective_only: bool
) -> Option<impl Iterator<Item = (CollisionObjectSlabHandle, CollisionObjectSlabHandle, &Interaction<N>)>>
pub fn interactions_with(
&self,
handle: CollisionObjectSlabHandle,
effective_only: bool
) -> Option<impl Iterator<Item = (CollisionObjectSlabHandle, CollisionObjectSlabHandle, &Interaction<N>)>>
All the interaction pairs involving the specified collision object.
Refer to the official user guide for details.
sourcepub fn interactions_with_mut(
&mut self,
handle: CollisionObjectSlabHandle
) -> Option<(&mut NarrowPhase<N, CollisionObjectSlabHandle>, impl Iterator<Item = (CollisionObjectSlabHandle, CollisionObjectSlabHandle, TemporaryInteractionIndex, &mut Interaction<N>)>)>
pub fn interactions_with_mut(
&mut self,
handle: CollisionObjectSlabHandle
) -> Option<(&mut NarrowPhase<N, CollisionObjectSlabHandle>, impl Iterator<Item = (CollisionObjectSlabHandle, CollisionObjectSlabHandle, TemporaryInteractionIndex, &mut Interaction<N>)>)>
All the mutable interactions pairs involving the specified collision object.
This also returns a mutable reference to the narrow-phase which is necessary for updating the interaction if needed. For interactions between a collision object and itself, only one mutable reference to the collision object is returned.
sourcepub fn proximities_with(
&self,
handle: CollisionObjectSlabHandle,
effective_only: bool
) -> Option<impl Iterator<Item = (CollisionObjectSlabHandle, CollisionObjectSlabHandle, &dyn ProximityDetector<N>, Proximity)>>
pub fn proximities_with(
&self,
handle: CollisionObjectSlabHandle,
effective_only: bool
) -> Option<impl Iterator<Item = (CollisionObjectSlabHandle, CollisionObjectSlabHandle, &dyn ProximityDetector<N>, Proximity)>>
All the proximity pairs involving the specified collision object.
Refer to the official user guide for details.
sourcepub fn contacts_with(
&self,
handle: CollisionObjectSlabHandle,
effective_only: bool
) -> Option<impl Iterator<Item = (CollisionObjectSlabHandle, CollisionObjectSlabHandle, &ContactAlgorithm<N>, &ContactManifold<N>)>>
pub fn contacts_with(
&self,
handle: CollisionObjectSlabHandle,
effective_only: bool
) -> Option<impl Iterator<Item = (CollisionObjectSlabHandle, CollisionObjectSlabHandle, &ContactAlgorithm<N>, &ContactManifold<N>)>>
All the contact pairs involving the specified collision object.
Refer to the official user guide for details.
sourcepub fn collision_objects_interacting_with<'a>(
&'a self,
handle: CollisionObjectSlabHandle
) -> Option<impl Iterator<Item = CollisionObjectSlabHandle> + 'a>
pub fn collision_objects_interacting_with<'a>(
&'a self,
handle: CollisionObjectSlabHandle
) -> Option<impl Iterator<Item = CollisionObjectSlabHandle> + 'a>
All the collision object handles of collision objects interacting with the specified collision object.
Refer to the official user guide for details.
sourcepub fn collision_objects_in_contact_with<'a>(
&'a self,
handle: CollisionObjectSlabHandle
) -> Option<impl Iterator<Item = CollisionObjectSlabHandle> + 'a>
pub fn collision_objects_in_contact_with<'a>(
&'a self,
handle: CollisionObjectSlabHandle
) -> Option<impl Iterator<Item = CollisionObjectSlabHandle> + 'a>
All the collision object handles of collision objects in potential contact with the specified collision object.
Refer to the official user guide for details.
sourcepub fn collision_objects_in_proximity_of<'a>(
&'a self,
handle: CollisionObjectSlabHandle
) -> Option<impl Iterator<Item = CollisionObjectSlabHandle> + 'a>
pub fn collision_objects_in_proximity_of<'a>(
&'a self,
handle: CollisionObjectSlabHandle
) -> Option<impl Iterator<Item = CollisionObjectSlabHandle> + 'a>
All the collision object handles of collision objects in potential proximity of with the specified collision object.
Refer to the official user guide for details.
sourcepub fn contact_events(&self) -> &ContactEvents<CollisionObjectSlabHandle>
pub fn contact_events(&self) -> &ContactEvents<CollisionObjectSlabHandle>
The contact events pool.
sourcepub fn proximity_events(&self) -> &ProximityEvents<CollisionObjectSlabHandle>
pub fn proximity_events(&self) -> &ProximityEvents<CollisionObjectSlabHandle>
The proximity events pool.
Auto Trait Implementations
impl<N, T> !RefUnwindSafe for CollisionWorld<N, T>
impl<N, T> Send for CollisionWorld<N, T> where
T: Send,
impl<N, T> Sync for CollisionWorld<N, T> where
T: Sync,
impl<N, T> Unpin for CollisionWorld<N, T> where
N: Unpin,
T: Unpin,
impl<N, T> !UnwindSafe for CollisionWorld<N, T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> CheckedAs for T
impl<T> CheckedAs for T
sourcefn checked_as<Dst>(self) -> Option<Dst> where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst> where
T: CheckedCast<Dst>,
Casts the value.
sourceimpl<Src, Dst> CheckedCastFrom<Src> for Dst where
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dst where
Src: CheckedCast<Dst>,
sourcefn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
sourceimpl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
sourcefn 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 more
sourcefn 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 more
sourcefn 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 more
sourcefn 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 more
sourceimpl<T> DowncastSync for T where
T: Any + Send + Sync,
impl<T> DowncastSync for T where
T: Any + Send + Sync,
sourceimpl<Src, Dst> LosslessTryInto<Dst> for Src where
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Src where
Dst: LosslessTryFrom<Src>,
sourcefn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Performs the conversion.
sourceimpl<Src, Dst> LossyInto<Dst> for Src where
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Src where
Dst: LossyFrom<Src>,
sourcefn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Performs the conversion.
sourceimpl<T> OverflowingAs for T
impl<T> OverflowingAs for T
sourcefn overflowing_as<Dst>(self) -> (Dst, bool) where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool) where
T: OverflowingCast<Dst>,
Casts the value.
sourceimpl<Src, Dst> OverflowingCastFrom<Src> for Dst where
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dst where
Src: OverflowingCast<Dst>,
sourcefn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
OverflowingCasts the value.
sourceimpl<T> SaturatingAs for T
impl<T> SaturatingAs for T
sourcefn saturating_as<Dst>(self) -> Dst where
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dst where
T: SaturatingCast<Dst>,
Casts the value.
sourceimpl<Src, Dst> SaturatingCastFrom<Src> for Dst where
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dst where
Src: SaturatingCast<Dst>,
sourcefn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
sourceimpl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
sourcefn 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 more
sourcefn 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).
sourcefn 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.
sourcefn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
sourceimpl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
sourcefn unwrapped_as<Dst>(self) -> Dst where
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dst where
T: UnwrappedCast<Dst>,
Casts the value.
sourceimpl<Src, Dst> UnwrappedCastFrom<Src> for Dst where
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dst where
Src: UnwrappedCast<Dst>,
sourcefn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
UnwrappedCasts the value.
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WrappingAs for T
impl<T> WrappingAs for T
sourcefn wrapping_as<Dst>(self) -> Dst where
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dst where
T: WrappingCast<Dst>,
Casts the value.
sourceimpl<Src, Dst> WrappingCastFrom<Src> for Dst where
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dst where
Src: WrappingCast<Dst>,
sourcefn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
WrappingCasts the value.