pub struct RapierContextSimulation {
pub islands: IslandManager,
pub broad_phase: DefaultBroadPhase,
pub narrow_phase: NarrowPhase,
pub ccd_solver: CCDSolver,
pub pipeline: PhysicsPipeline,
pub collision_pipeline: CollisionPipeline,
pub integration_parameters: IntegrationParameters,
/* private fields */
}Expand description
The Rapier context, containing parts of the state of the physics engine, specific to the simulation step.
This is the main driver for a rapier context, which will create other required components if needed.
Additionally to its required components, this component is also always paired with a RapierConfiguration component.
Fields§
§islands: IslandManagerThe island manager, which detects what object is sleeping (not moving much) to reduce computations.
broad_phase: DefaultBroadPhaseThe broad-phase, which detects potential contact pairs.
narrow_phase: NarrowPhaseThe narrow-phase, which computes contact points, tests intersections, and maintain the contact and intersection graphs.
ccd_solver: CCDSolverThe solver, which handles Continuous Collision Detection (CCD).
pipeline: PhysicsPipelineThe physics pipeline, which advance the simulation step by step.
collision_pipeline: CollisionPipelineThe collision pipeline, which only runs collision detection when the context is in
SimulationMode::CollisionOnly.
integration_parameters: IntegrationParametersThe integration parameters, controlling various low-level coefficient of the simulation.
Implementations§
Source§impl RapierContextSimulation
impl RapierContextSimulation
Sourcepub fn with_broad_phase_optimization_strategy(
strategy: BroadPhaseOptimizationStrategy,
) -> Self
pub fn with_broad_phase_optimization_strategy( strategy: BroadPhaseOptimizationStrategy, ) -> Self
Creates a simulation context whose broad-phase uses the given BVH optimization strategy.
This is what RapierContextInitialization::InitializeDefaultRapierContext uses for the
default context.
Sourcepub fn step_stats(&self) -> &SimulationStepStats
pub fn step_stats(&self) -> &SimulationStepStats
Statistics about the simulation steps executed during the last physics update.
Sourcepub fn set_num_threads(&mut self, num_threads: Option<usize>)
pub fn set_num_threads(&mut self, num_threads: Option<usize>)
Sets the number of threads of the thread pool dedicated to this context’s simulation, or
removes that pool if num_threads is None.
The pool is only rebuilt if num_threads differs from the value of the previous call. This
is called automatically with RapierConfiguration::num_threads before each simulation
step, and does nothing unless the parallel feature is enabled (and unsync-callbacks
is not).
Sourcepub fn with_query_dispatcher<D>(dispatcher: D) -> Self
pub fn with_query_dispatcher<D>(dispatcher: D) -> Self
Creates a simulation context whose narrow-phase uses a custom query dispatcher.
The query dispatcher computes the contact manifolds and intersections between pairs of
shapes, which makes it possible to support custom shapes or override the contact
generation of existing ones. Spawn it with
RapierContextInitialization::NoAutomaticRapierContext,
or see Self::set_query_dispatcher for the default context.
Sourcepub fn set_query_dispatcher<D>(&mut self, dispatcher: D)
pub fn set_query_dispatcher<D>(&mut self, dispatcher: D)
Replaces the narrow-phase with an empty one using the given custom query dispatcher.
This discards every contact and intersection pair of the current narrow-phase, so it
must be called before any collider is added to this context (for example in a
Startup system, since colliders are inserted during PhysicsSet::SyncBackend).
Sourcepub fn query_dispatcher(
&self,
) -> &dyn PersistentQueryDispatcher<ContactManifoldData, ContactData>
pub fn query_dispatcher( &self, ) -> &dyn PersistentQueryDispatcher<ContactManifoldData, ContactData>
The query dispatcher used by the narrow-phase to compute contacts and intersections.
Sourcepub fn set_event_handler(
&mut self,
handler: impl EventHandler + Send + Sync + 'static,
)
pub fn set_event_handler( &mut self, handler: impl EventHandler + Send + Sync + 'static, )
Installs a Rapier EventHandler called by the physics pipeline for every collision,
contact force and soft-body tear event.
It is called in addition to (not instead of) the forwarding of events as
CollisionEvent and ContactForceEvent Bevy messages, and replaces the previously
installed handler, if any. The handler receives raw Rapier handles: the entity of a
collider can be retrieved with RapierContextColliders::entity_from_collider. Note that
the colliders of an event flagged with CollisionEventFlags::REMOVED may no longer be
part of the collider set.
Sourcepub fn remove_event_handler(
&mut self,
) -> Option<Box<dyn EventHandler + Send + Sync>>
pub fn remove_event_handler( &mut self, ) -> Option<Box<dyn EventHandler + Send + Sync>>
Removes the event handler installed with Self::set_event_handler and returns it.
Sourcepub fn event_handler(&self) -> Option<&(dyn EventHandler + Send + Sync)>
pub fn event_handler(&self) -> Option<&(dyn EventHandler + Send + Sync)>
The event handler installed with Self::set_event_handler, if any.
Sourcepub fn tear_soft_body(
&mut self,
colliders: &mut RapierContextColliders,
joints: &mut RapierContextJoints,
rigidbody_set: &mut RapierRigidBodySet,
commands: &mut Commands<'_, '_>,
entity: Entity,
edges: &[u32],
cells: &[u32],
) -> Option<SoftBodyTearResult>
pub fn tear_soft_body( &mut self, colliders: &mut RapierContextColliders, joints: &mut RapierContextJoints, rigidbody_set: &mut RapierRigidBodySet, commands: &mut Commands<'_, '_>, entity: Entity, edges: &[u32], cells: &[u32], ) -> Option<SoftBodyTearResult>
Tears the soft body of entity right away along the given edges and through the given
cells (see SoftBodySet::tear).
The entities of the pieces split off the soft body are spawned with commands and
returned right away; they get their components and a
SoftBodyTearEvent message is sent during the next
PhysicsSet::Writeback (see
SoftBodyTearResult). Returns None if entity has no soft body or if nothing changed.
Sourcepub fn cut_soft_body(
&mut self,
colliders: &mut RapierContextColliders,
joints: &mut RapierContextJoints,
rigidbody_set: &mut RapierRigidBodySet,
commands: &mut Commands<'_, '_>,
entity: Entity,
blade: &[Vect; 3],
) -> Option<SoftBodyTearResult>
pub fn cut_soft_body( &mut self, colliders: &mut RapierContextColliders, joints: &mut RapierContextJoints, rigidbody_set: &mut RapierRigidBodySet, commands: &mut Commands<'_, '_>, entity: Entity, blade: &[Vect; 3], ) -> Option<SoftBodyTearResult>
Cuts the soft body of entity right away along a blade: a world-space segment in 2D, a
world-space triangle in 3D (see SoftBodySet::cut).
The entities of the pieces split off the soft body are spawned with commands and
returned right away; they get their components and a
SoftBodyTearEvent message is sent during the next
PhysicsSet::Writeback (see
SoftBodyTearResult). Returns None if entity has no soft body or if nothing changed.
Sourcepub fn step_simulation(
&mut self,
colliders: &mut RapierContextColliders,
joints: &mut RapierContextJoints,
rigidbody_set: &mut RapierRigidBodySet,
gravity: Vect,
simulation_mode: SimulationMode,
timestep_mode: TimestepMode,
events: Option<(&MessageWriter<'_, CollisionEvent>, &MessageWriter<'_, ContactForceEvent>)>,
hooks: &dyn PhysicsHooks,
time: &Time,
sim_to_render_time: &mut SimulationToRenderTime,
interpolation_query: Option<&mut Query<'_, '_, (&RapierRigidBodyHandle, &mut TransformInterpolation)>>,
)
pub fn step_simulation( &mut self, colliders: &mut RapierContextColliders, joints: &mut RapierContextJoints, rigidbody_set: &mut RapierRigidBodySet, gravity: Vect, simulation_mode: SimulationMode, timestep_mode: TimestepMode, events: Option<(&MessageWriter<'_, CollisionEvent>, &MessageWriter<'_, ContactForceEvent>)>, hooks: &dyn PhysicsHooks, time: &Time, sim_to_render_time: &mut SimulationToRenderTime, interpolation_query: Option<&mut Query<'_, '_, (&RapierRigidBodyHandle, &mut TransformInterpolation)>>, )
Advance the simulation, based on the given timestep mode.
With SimulationMode::CollisionOnly, only collision detection runs at each step (see
SimulationMode).
Steps with a zero (or negative) dt, like the first frame with TimestepMode::Variable,
are skipped entirely.
Sourcepub fn send_quarantine_events(
&mut self,
context: Entity,
quarantine_event_writer: &mut MessageWriter<'_, PhysicsQuarantineEvent>,
)
pub fn send_quarantine_events( &mut self, context: Entity, quarantine_event_writer: &mut MessageWriter<'_, PhysicsQuarantineEvent>, )
Sends a PhysicsQuarantineEvent (and logs a warning) if some rigid-bodies, colliders or
soft bodies were quarantined by the simulation steps executed since the last call.
context is the entity of this context. This is called automatically by the
step_simulation system.
Sourcepub fn send_bevy_events(
&mut self,
collision_event_writer: &mut MessageWriter<'_, CollisionEvent>,
contact_force_event_writer: &mut MessageWriter<'_, ContactForceEvent>,
)
pub fn send_bevy_events( &mut self, collision_event_writer: &mut MessageWriter<'_, CollisionEvent>, contact_force_event_writer: &mut MessageWriter<'_, ContactForceEvent>, )
Generates bevy events for any physics interactions that have happened that are stored in the events list
Sourcepub fn move_shape(
&mut self,
colliders: &mut RapierContextColliders,
rigidbody_set: &mut RapierRigidBodySet,
movement: Vect,
shape: &(impl AsShape + ?Sized),
shape_translation: Vect,
shape_rotation: Rot,
shape_mass: f32,
options: &MoveShapeOptions,
filter: QueryFilter<'_>,
events: impl FnMut(CharacterCollision),
) -> MoveShapeOutput
pub fn move_shape( &mut self, colliders: &mut RapierContextColliders, rigidbody_set: &mut RapierRigidBodySet, movement: Vect, shape: &(impl AsShape + ?Sized), shape_translation: Vect, shape_rotation: Rot, shape_mass: f32, options: &MoveShapeOptions, filter: QueryFilter<'_>, events: impl FnMut(CharacterCollision), ) -> MoveShapeOutput
Attempts to move shape, optionally sliding or climbing obstacles.
The obstacles are the colliders of this context matching filter, detected with this
context’s query dispatcher.
§Parameters
colliders,rigidbody_set: the collider and rigid-body sets of this context.movement: the translational movement to apply.shape: the shape to move.shape_translation: the initial position of the shape.shape_rotation: the rotation of the shape.shape_mass: the mass of the shape to be considered by the impulse calculation ifMoveShapeOptions::apply_impulse_to_dynamic_bodiesis set to true.options: configures the behavior of the automatic sliding and climbing.filter: selects the colliders the shape can collide with (exclude the collider or rigid-body of the moved shape itself).events: callback run on each obstacle hit by the shape on its path, once the movement is computed.
Source§impl RapierContextSimulation
impl RapierContextSimulation
Sourcepub fn contact_pairs_with<'a, 'b: 'a>(
&'a self,
context_colliders: &'b RapierContextColliders,
rigidbody_set: &'b RapierRigidBodySet,
collider: Entity,
) -> impl Iterator<Item = ContactPairView<'a>>
pub fn contact_pairs_with<'a, 'b: 'a>( &'a self, context_colliders: &'b RapierContextColliders, rigidbody_set: &'b RapierRigidBodySet, collider: Entity, ) -> impl Iterator<Item = ContactPairView<'a>>
All the contact pairs involving the non-sensor collider attached to the given entity.
The returned contact pairs identify pairs of colliders with intersecting bounding-volumes.
To check if any geometric contact happened between the collider shapes, check
ContactPairView::has_any_active_contact.
Sourcepub fn intersection_pairs_with<'a, 'b: 'a>(
&'a self,
rapier_colliders: &'b RapierContextColliders,
collider: Entity,
) -> impl Iterator<Item = (Entity, Entity, bool)> + 'a
pub fn intersection_pairs_with<'a, 'b: 'a>( &'a self, rapier_colliders: &'b RapierContextColliders, collider: Entity, ) -> impl Iterator<Item = (Entity, Entity, bool)> + 'a
All the intersection pairs involving the collider attached to the given entity, where at least one collider involved in the intersection is a sensor.
The returned contact pairs identify pairs of colliders (where at least one is a sensor) with intersecting bounding-volumes. To check if any geometric overlap happened between the collider shapes, check the returned boolean.
Sourcepub fn contact_pair<'a, 'b: 'a>(
&'a self,
context_colliders: &'b RapierContextColliders,
rigidbody_set: &'b RapierRigidBodySet,
collider1: Entity,
collider2: Entity,
) -> Option<ContactPairView<'a>>
pub fn contact_pair<'a, 'b: 'a>( &'a self, context_colliders: &'b RapierContextColliders, rigidbody_set: &'b RapierRigidBodySet, collider1: Entity, collider2: Entity, ) -> Option<ContactPairView<'a>>
The contact pair involving two specific colliders.
If this returns None, there is no contact between the two colliders.
If this returns Some, then there may be a contact between the two colliders. Check the
result ContactPairView::has_any_active_contact method to see if there is an actual contact.
Sourcepub fn intersection_pair(
&self,
rapier_colliders: &RapierContextColliders,
collider1: Entity,
collider2: Entity,
) -> Option<bool>
pub fn intersection_pair( &self, rapier_colliders: &RapierContextColliders, collider1: Entity, collider2: Entity, ) -> Option<bool>
The intersection pair involving two specific colliders (at least one being a sensor).
If this returns None or Some(false), then there is no intersection between the two colliders.
If this returns Some(true), then there may be an intersection between the two colliders.
Sourcepub fn contact_pairs<'a, 'b: 'a>(
&'a self,
context_colliders: &'b RapierContextColliders,
rigidbody_set: &'b RapierRigidBodySet,
) -> impl Iterator<Item = ContactPairView<'a>>
pub fn contact_pairs<'a, 'b: 'a>( &'a self, context_colliders: &'b RapierContextColliders, rigidbody_set: &'b RapierRigidBodySet, ) -> impl Iterator<Item = ContactPairView<'a>>
All the contact pairs detected during the last timestep.
Sourcepub fn contact_graph(&self) -> &InteractionGraph<ColliderHandle, ContactPair>
pub fn contact_graph(&self) -> &InteractionGraph<ColliderHandle, ContactPair>
The raw contact graph of the narrow-phase.
Its nodes are the Rapier handles of the colliders, and its edges the raw contact pairs
between non-sensor colliders with intersecting bounding volumes. Prefer
Self::contact_pairs and Self::contact_pairs_with which yield Bevy entities.
Sourcepub fn intersection_graph(
&self,
) -> &InteractionGraph<ColliderHandle, IntersectionPair>
pub fn intersection_graph( &self, ) -> &InteractionGraph<ColliderHandle, IntersectionPair>
The raw intersection graph of the narrow-phase.
Its nodes are the Rapier handles of the colliders, and its edges the raw intersection
pairs involving at least one sensor. Prefer Self::intersection_pairs and
Self::intersection_pairs_with which yield Bevy entities.
Sourcepub fn intersection_pairs<'a, 'b: 'a>(
&'a self,
rapier_colliders: &'b RapierContextColliders,
) -> impl Iterator<Item = (Entity, Entity, bool)> + 'a
pub fn intersection_pairs<'a, 'b: 'a>( &'a self, rapier_colliders: &'b RapierContextColliders, ) -> impl Iterator<Item = (Entity, Entity, bool)> + 'a
All the intersection pairs detected during the last timestep.
Trait Implementations§
Source§impl Component for RapierContextSimulation
Required Components: RapierContextColliders, RapierRigidBodySet, RapierContextJoints, SimulationToRenderTime.
impl Component for RapierContextSimulation
Required Components: RapierContextColliders, RapierRigidBodySet, RapierContextJoints, SimulationToRenderTime.
A component’s Required Components are inserted whenever it is inserted. Note that this will also insert the required components of the required components, recursively, in depth-first order.
Source§const STORAGE_TYPE: StorageType = ::bevy::ecs::component::StorageType::Table
const STORAGE_TYPE: StorageType = ::bevy::ecs::component::StorageType::Table
Source§type Mutability = Mutable
type Mutability = Mutable
Component<Mutability = Mutable>,
while immutable components will instead have Component<Mutability = Immutable>. Read moreSource§fn register_required_components(
_requiree: ComponentId,
required_components: &mut RequiredComponentsRegistrator<'_, '_>,
)
fn register_required_components( _requiree: ComponentId, required_components: &mut RequiredComponentsRegistrator<'_, '_>, )
Source§fn clone_behavior() -> ComponentCloneBehavior
fn clone_behavior() -> ComponentCloneBehavior
Source§fn relationship_accessor() -> Option<ComponentRelationshipAccessor<Self>>
fn relationship_accessor() -> Option<ComponentRelationshipAccessor<Self>>
ComponentRelationshipAccessor required for working with relationships in dynamic contexts. Read moreSource§fn on_add() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_add() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_insert() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_insert() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_remove() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_remove() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn map_entities<E>(_this: &mut Self, _mapper: &mut E)where
E: EntityMapper,
fn map_entities<E>(_this: &mut Self, _mapper: &mut E)where
E: EntityMapper,
EntityMapper. This is used to remap entities in contexts like scenes and entity cloning.
When deriving Component, this is populated by annotating fields containing entities with #[entities] Read moreSource§const HAS_SUMMARY_TICK: bool = false
const HAS_SUMMARY_TICK: bool = false
Auto Trait Implementations§
impl !Freeze for RapierContextSimulation
impl !RefUnwindSafe for RapierContextSimulation
impl !UnwindSafe for RapierContextSimulation
impl Send for RapierContextSimulation
impl Sync for RapierContextSimulation
impl Unpin for RapierContextSimulation
impl UnsafeUnpin for RapierContextSimulation
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
T ShaderType for self. When used in AsBindGroup
derives, it is safe to assume that all images in self exist.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<C> Bundle for Cwhere
C: Component,
impl<C> Bundle for Cwhere
C: Component,
fn component_ids( components: &mut ComponentsRegistrator<'_>, ) -> impl Iterator<Item = ComponentId> + use<C>
Source§fn get_component_ids(
components: &Components,
) -> impl Iterator<Item = Option<ComponentId>>
fn get_component_ids( components: &Components, ) -> impl Iterator<Item = Option<ComponentId>>
Source§impl<C> BundleFromComponents for Cwhere
C: Component,
impl<C> BundleFromComponents for Cwhere
C: Component,
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ConditionalSend for Twhere
T: Send,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn 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.Source§fn 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.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<C> DynamicBundle for Cwhere
C: Component,
impl<C> DynamicBundle for Cwhere
C: Component,
Source§unsafe fn get_components(
ptr: MovingPtr<'_, C>,
func: &mut impl FnMut(StorageType, OwningPtr<'_>),
) -> <C as DynamicBundle>::Effect
unsafe fn get_components( ptr: MovingPtr<'_, C>, func: &mut impl FnMut(StorageType, OwningPtr<'_>), ) -> <C as DynamicBundle>::Effect
Source§unsafe fn apply_effect(
_ptr: MovingPtr<'_, MaybeUninit<C>>,
_entity: &mut EntityWorldMut<'_>,
)
unsafe fn apply_effect( _ptr: MovingPtr<'_, MaybeUninit<C>>, _entity: &mut EntityWorldMut<'_>, )
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
impl<T> MaybeSync for T
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Settings for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn 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).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.