#[repr(C)]pub struct RoundShape<S> {
pub inner_shape: S,
pub border_radius: f32,
}Expand description
A shape with rounded borders.
§What is a Rounded Shape?
A RoundShape wraps an existing shape and adds a “border radius” around it. This creates
a smooth, rounded version of the original shape by effectively expanding it outward by
the border radius distance. Think of it as adding padding or a cushion around the shape.
The rounding is achieved by using Minkowski sum operations: any point on the surface of the rounded shape is computed by taking a point on the original shape’s surface and moving it outward along the surface normal by the border radius distance.
§Common Use Cases
- Creating softer collisions: Rounded shapes can make collision detection more forgiving and realistic, as sharp corners and edges are smoothed out.
- Capsule-like shapes: You can create capsule variations of any shape by adding a border radius (e.g., a rounded cuboid becomes similar to a capsule).
- Visual aesthetics: Rounded shapes often look more pleasing and natural than sharp-edged shapes.
- Improved numerical stability: Rounded shapes can sometimes be more numerically stable in collision detection algorithms since they avoid sharp corners.
§Examples
§Creating a Rounded Cuboid
use parry3d::shape::{RoundShape, Cuboid};
use parry3d_f64::shape::{RoundShape, Cuboid};
use nalgebra::Vector3;
// Create a cuboid with half-extents of 1.0 in each direction
let cuboid = Cuboid::new(Vector3::new(1.0, 1.0, 1.0));
// Add a border radius of 0.2 to create a rounded cuboid
let rounded_cuboid = RoundShape {
inner_shape: cuboid,
border_radius: 0.2,
};
// The effective size is now 1.2 in each direction from the center
// (1.0 from the cuboid + 0.2 from the border)
assert_eq!(rounded_cuboid.inner_shape.half_extents.x, 1.0);
assert_eq!(rounded_cuboid.border_radius, 0.2);§Creating a Rounded Triangle (2D)
use parry2d::shape::{RoundShape, Triangle};
use parry2d_f64::shape::{RoundShape, Triangle};
use nalgebra::Point2;
// Create a triangle
let triangle = Triangle::new(
Point2::origin(),
Point2::new(1.0, 0.0),
Point2::new(0.0, 1.0),
);
// Add rounding with a 0.1 border radius
let rounded_triangle = RoundShape {
inner_shape: triangle,
border_radius: 0.1,
};
// The rounded triangle will have smooth, curved edges instead of sharp corners
assert_eq!(rounded_triangle.border_radius, 0.1);§Comparing Support Points
This example shows how the border radius affects the support point calculation:
use parry3d::shape::{RoundShape, Cuboid, SupportMap};
use parry3d_f64::shape::{RoundShape, Cuboid, SupportMap};
use nalgebra::Vector3;
let cuboid = Cuboid::new(Vector3::new(1.0, 1.0, 1.0));
let rounded_cuboid = RoundShape {
inner_shape: cuboid,
border_radius: 0.5,
};
// Query the support point in the direction (1, 1, 1)
let direction = Vector3::new(1.0, 1.0, 1.0);
let support_point = rounded_cuboid.local_support_point(&direction);
// The support point will be further out than the original cuboid's support point
// due to the border radius
let cuboid_support = cuboid.local_support_point(&direction);
// The rounded shape extends further in all directions
assert!(support_point.x > cuboid_support.x);
assert!(support_point.y > cuboid_support.y);
assert!(support_point.z > cuboid_support.z);§Using with Different Shape Types
RoundShape can wrap any shape that implements the SupportMap trait:
use parry3d::shape::{RoundShape, Ball, Segment, SupportMap};
use parry3d_f64::shape::{RoundShape, Ball, Segment, SupportMap};
use nalgebra::{Point3, Vector3};
// Rounded ball (creates a slightly larger sphere)
let ball = Ball::new(1.0);
let rounded_ball = RoundShape {
inner_shape: ball,
border_radius: 0.1,
};
// Effective radius is now 1.1
// Rounded segment (creates a capsule)
let segment = Segment::new(
Point3::origin(),
Point3::new(0.0, 2.0, 0.0),
);
let rounded_segment = RoundShape {
inner_shape: segment,
border_radius: 0.5,
};
// This creates a capsule with radius 0.5§Performance Considerations
- The computational cost of queries on a
RoundShapeis essentially the same as for the inner shape, plus a small constant overhead to apply the border radius. RoundShapeis most efficient when used with shapes that already implementSupportMapefficiently (like primitives: Ball, Cuboid, Capsule, etc.).- The struct is
Copywhen the inner shape isCopy, making it efficient to pass around.
§Technical Details
The RoundShape implements the SupportMap trait by computing the support point of the
inner shape and then offsetting it by the border radius in the query direction. This is
mathematically equivalent to computing the Minkowski sum of the inner shape with a ball
of radius equal to the border radius.
Fields§
§inner_shape: SThe shape being rounded.
This is the original, “inner” shape before the border radius is applied.
The rounded shape’s surface will be at a distance of border_radius from
this inner shape’s surface.
border_radius: f32The radius of the rounded border.
This value determines how much the shape is expanded outward. A larger border radius creates a more “padded” shape. Must be non-negative (typically positive).
For example, if border_radius is 0.5, every point on the original shape’s
surface will be moved 0.5 units outward along its surface normal.
Implementations§
Trait Implementations§
Source§impl<S: Clone> Clone for RoundShape<S>
impl<S: Clone> Clone for RoundShape<S>
Source§fn clone(&self) -> RoundShape<S>
fn clone(&self) -> RoundShape<S>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<S: Debug> Debug for RoundShape<S>
impl<S: Debug> Debug for RoundShape<S>
Source§impl<S: SupportMap> PointQuery for RoundShape<S>
impl<S: SupportMap> PointQuery for RoundShape<S>
Source§fn project_local_point(
&self,
point: &Point<f32>,
solid: bool,
) -> PointProjection
fn project_local_point( &self, point: &Point<f32>, solid: bool, ) -> PointProjection
self. Read moreSource§fn project_local_point_and_get_feature(
&self,
point: &Point<f32>,
) -> (PointProjection, FeatureId)
fn project_local_point_and_get_feature( &self, point: &Point<f32>, ) -> (PointProjection, FeatureId)
self and returns the id of the
feature the point was projected on.Source§fn project_local_point_with_max_dist(
&self,
pt: &Point<f32>,
solid: bool,
max_dist: f32,
) -> Option<PointProjection>
fn project_local_point_with_max_dist( &self, pt: &Point<f32>, solid: bool, max_dist: f32, ) -> Option<PointProjection>
Source§fn project_point_with_max_dist(
&self,
m: &Isometry<f32>,
pt: &Point<f32>,
solid: bool,
max_dist: f32,
) -> Option<PointProjection>
fn project_point_with_max_dist( &self, m: &Isometry<f32>, pt: &Point<f32>, solid: bool, max_dist: f32, ) -> Option<PointProjection>
self transformed by m, unless the projection lies further than the given max distance.Source§fn distance_to_local_point(&self, pt: &Point<f32>, solid: bool) -> f32
fn distance_to_local_point(&self, pt: &Point<f32>, solid: bool) -> f32
self.Source§fn contains_local_point(&self, pt: &Point<f32>) -> bool
fn contains_local_point(&self, pt: &Point<f32>) -> bool
self.Source§fn project_point(
&self,
m: &Isometry<f32>,
pt: &Point<f32>,
solid: bool,
) -> PointProjection
fn project_point( &self, m: &Isometry<f32>, pt: &Point<f32>, solid: bool, ) -> PointProjection
self transformed by m.Source§fn distance_to_point(
&self,
m: &Isometry<f32>,
pt: &Point<f32>,
solid: bool,
) -> f32
fn distance_to_point( &self, m: &Isometry<f32>, pt: &Point<f32>, solid: bool, ) -> f32
self transformed by m.Source§fn project_point_and_get_feature(
&self,
m: &Isometry<f32>,
pt: &Point<f32>,
) -> (PointProjection, FeatureId)
fn project_point_and_get_feature( &self, m: &Isometry<f32>, pt: &Point<f32>, ) -> (PointProjection, FeatureId)
self transformed by m and returns the id of the
feature the point was projected on.Source§impl<S: SupportMap> RayCast for RoundShape<S>
impl<S: SupportMap> RayCast for RoundShape<S>
Source§fn cast_local_ray_and_get_normal(
&self,
ray: &Ray,
max_time_of_impact: f32,
solid: bool,
) -> Option<RayIntersection>
fn cast_local_ray_and_get_normal( &self, ray: &Ray, max_time_of_impact: f32, solid: bool, ) -> Option<RayIntersection>
Source§fn cast_local_ray(
&self,
ray: &Ray,
max_time_of_impact: f32,
solid: bool,
) -> Option<f32>
fn cast_local_ray( &self, ray: &Ray, max_time_of_impact: f32, solid: bool, ) -> Option<f32>
Source§fn intersects_local_ray(&self, ray: &Ray, max_time_of_impact: f32) -> bool
fn intersects_local_ray(&self, ray: &Ray, max_time_of_impact: f32) -> bool
Source§fn cast_ray(
&self,
m: &Isometry<f32>,
ray: &Ray,
max_time_of_impact: f32,
solid: bool,
) -> Option<f32>
fn cast_ray( &self, m: &Isometry<f32>, ray: &Ray, max_time_of_impact: f32, solid: bool, ) -> Option<f32>
Source§fn cast_ray_and_get_normal(
&self,
m: &Isometry<f32>,
ray: &Ray,
max_time_of_impact: f32,
solid: bool,
) -> Option<RayIntersection>
fn cast_ray_and_get_normal( &self, m: &Isometry<f32>, ray: &Ray, max_time_of_impact: f32, solid: bool, ) -> Option<RayIntersection>
Source§impl Shape for RoundShape<Cone>
impl Shape for RoundShape<Cone>
Source§fn scale_dyn(
&self,
scale: &Vector<f32>,
num_subdivisions: u32,
) -> Option<Box<dyn Shape>>
fn scale_dyn( &self, scale: &Vector<f32>, num_subdivisions: u32, ) -> Option<Box<dyn Shape>>
scale into a boxed trait-object. Read moreSource§fn compute_local_aabb(&self) -> Aabb
fn compute_local_aabb(&self) -> Aabb
Aabb of this shape.Source§fn compute_local_bounding_sphere(&self) -> BoundingSphere
fn compute_local_bounding_sphere(&self) -> BoundingSphere
Source§fn compute_aabb(&self, position: &Isometry<f32>) -> Aabb
fn compute_aabb(&self, position: &Isometry<f32>) -> Aabb
Aabb of this shape with the given position.Source§fn mass_properties(&self, density: f32) -> MassProperties
fn mass_properties(&self, density: f32) -> MassProperties
Source§fn shape_type(&self) -> ShapeType
fn shape_type(&self) -> ShapeType
Source§fn as_typed_shape(&self) -> TypedShape<'_>
fn as_typed_shape(&self) -> TypedShape<'_>
fn ccd_thickness(&self) -> f32
fn ccd_angular_thickness(&self) -> f32
Source§fn as_support_map(&self) -> Option<&dyn SupportMap>
fn as_support_map(&self) -> Option<&dyn SupportMap>
Source§fn as_polygonal_feature_map(&self) -> Option<(&dyn PolygonalFeatureMap, f32)>
fn as_polygonal_feature_map(&self) -> Option<(&dyn PolygonalFeatureMap, f32)>
Source§fn clone_box(&self) -> Box<dyn Shape>
fn clone_box(&self) -> Box<dyn Shape>
clone_dynSource§fn compute_bounding_sphere(&self, position: &Isometry<f32>) -> BoundingSphere
fn compute_bounding_sphere(&self, position: &Isometry<f32>) -> BoundingSphere
fn as_composite_shape(&self) -> Option<&dyn CompositeShape>
Source§impl Shape for RoundShape<ConvexPolyhedron>
impl Shape for RoundShape<ConvexPolyhedron>
Source§fn scale_dyn(
&self,
scale: &Vector<f32>,
num_subdivisions: u32,
) -> Option<Box<dyn Shape>>
fn scale_dyn( &self, scale: &Vector<f32>, num_subdivisions: u32, ) -> Option<Box<dyn Shape>>
scale into a boxed trait-object. Read moreSource§fn compute_local_aabb(&self) -> Aabb
fn compute_local_aabb(&self) -> Aabb
Aabb of this shape.Source§fn compute_local_bounding_sphere(&self) -> BoundingSphere
fn compute_local_bounding_sphere(&self) -> BoundingSphere
Source§fn compute_aabb(&self, position: &Isometry<f32>) -> Aabb
fn compute_aabb(&self, position: &Isometry<f32>) -> Aabb
Aabb of this shape with the given position.Source§fn mass_properties(&self, density: f32) -> MassProperties
fn mass_properties(&self, density: f32) -> MassProperties
Source§fn shape_type(&self) -> ShapeType
fn shape_type(&self) -> ShapeType
Source§fn as_typed_shape(&self) -> TypedShape<'_>
fn as_typed_shape(&self) -> TypedShape<'_>
fn ccd_thickness(&self) -> f32
fn ccd_angular_thickness(&self) -> f32
Source§fn as_support_map(&self) -> Option<&dyn SupportMap>
fn as_support_map(&self) -> Option<&dyn SupportMap>
Source§fn as_polygonal_feature_map(&self) -> Option<(&dyn PolygonalFeatureMap, f32)>
fn as_polygonal_feature_map(&self) -> Option<(&dyn PolygonalFeatureMap, f32)>
Source§fn clone_box(&self) -> Box<dyn Shape>
fn clone_box(&self) -> Box<dyn Shape>
clone_dynSource§fn compute_bounding_sphere(&self, position: &Isometry<f32>) -> BoundingSphere
fn compute_bounding_sphere(&self, position: &Isometry<f32>) -> BoundingSphere
fn as_composite_shape(&self) -> Option<&dyn CompositeShape>
Source§impl Shape for RoundShape<Cuboid>
impl Shape for RoundShape<Cuboid>
Source§fn scale_dyn(
&self,
scale: &Vector<f32>,
num_subdivisions: u32,
) -> Option<Box<dyn Shape>>
fn scale_dyn( &self, scale: &Vector<f32>, num_subdivisions: u32, ) -> Option<Box<dyn Shape>>
scale into a boxed trait-object. Read moreSource§fn compute_local_aabb(&self) -> Aabb
fn compute_local_aabb(&self) -> Aabb
Aabb of this shape.Source§fn compute_local_bounding_sphere(&self) -> BoundingSphere
fn compute_local_bounding_sphere(&self) -> BoundingSphere
Source§fn compute_aabb(&self, position: &Isometry<f32>) -> Aabb
fn compute_aabb(&self, position: &Isometry<f32>) -> Aabb
Aabb of this shape with the given position.Source§fn mass_properties(&self, density: f32) -> MassProperties
fn mass_properties(&self, density: f32) -> MassProperties
Source§fn shape_type(&self) -> ShapeType
fn shape_type(&self) -> ShapeType
Source§fn as_typed_shape(&self) -> TypedShape<'_>
fn as_typed_shape(&self) -> TypedShape<'_>
fn ccd_thickness(&self) -> f32
fn ccd_angular_thickness(&self) -> f32
Source§fn as_support_map(&self) -> Option<&dyn SupportMap>
fn as_support_map(&self) -> Option<&dyn SupportMap>
Source§fn as_polygonal_feature_map(&self) -> Option<(&dyn PolygonalFeatureMap, f32)>
fn as_polygonal_feature_map(&self) -> Option<(&dyn PolygonalFeatureMap, f32)>
Source§fn clone_box(&self) -> Box<dyn Shape>
fn clone_box(&self) -> Box<dyn Shape>
clone_dynSource§fn compute_bounding_sphere(&self, position: &Isometry<f32>) -> BoundingSphere
fn compute_bounding_sphere(&self, position: &Isometry<f32>) -> BoundingSphere
fn as_composite_shape(&self) -> Option<&dyn CompositeShape>
Source§impl Shape for RoundShape<Cylinder>
impl Shape for RoundShape<Cylinder>
Source§fn scale_dyn(
&self,
scale: &Vector<f32>,
num_subdivisions: u32,
) -> Option<Box<dyn Shape>>
fn scale_dyn( &self, scale: &Vector<f32>, num_subdivisions: u32, ) -> Option<Box<dyn Shape>>
scale into a boxed trait-object. Read moreSource§fn compute_local_aabb(&self) -> Aabb
fn compute_local_aabb(&self) -> Aabb
Aabb of this shape.Source§fn compute_local_bounding_sphere(&self) -> BoundingSphere
fn compute_local_bounding_sphere(&self) -> BoundingSphere
Source§fn compute_aabb(&self, position: &Isometry<f32>) -> Aabb
fn compute_aabb(&self, position: &Isometry<f32>) -> Aabb
Aabb of this shape with the given position.Source§fn mass_properties(&self, density: f32) -> MassProperties
fn mass_properties(&self, density: f32) -> MassProperties
Source§fn shape_type(&self) -> ShapeType
fn shape_type(&self) -> ShapeType
Source§fn as_typed_shape(&self) -> TypedShape<'_>
fn as_typed_shape(&self) -> TypedShape<'_>
fn ccd_thickness(&self) -> f32
fn ccd_angular_thickness(&self) -> f32
Source§fn as_support_map(&self) -> Option<&dyn SupportMap>
fn as_support_map(&self) -> Option<&dyn SupportMap>
Source§fn as_polygonal_feature_map(&self) -> Option<(&dyn PolygonalFeatureMap, f32)>
fn as_polygonal_feature_map(&self) -> Option<(&dyn PolygonalFeatureMap, f32)>
Source§fn clone_box(&self) -> Box<dyn Shape>
fn clone_box(&self) -> Box<dyn Shape>
clone_dynSource§fn compute_bounding_sphere(&self, position: &Isometry<f32>) -> BoundingSphere
fn compute_bounding_sphere(&self, position: &Isometry<f32>) -> BoundingSphere
fn as_composite_shape(&self) -> Option<&dyn CompositeShape>
Source§impl Shape for RoundShape<Triangle>
impl Shape for RoundShape<Triangle>
Source§fn scale_dyn(
&self,
scale: &Vector<f32>,
num_subdivisions: u32,
) -> Option<Box<dyn Shape>>
fn scale_dyn( &self, scale: &Vector<f32>, num_subdivisions: u32, ) -> Option<Box<dyn Shape>>
scale into a boxed trait-object. Read moreSource§fn compute_local_aabb(&self) -> Aabb
fn compute_local_aabb(&self) -> Aabb
Aabb of this shape.Source§fn compute_local_bounding_sphere(&self) -> BoundingSphere
fn compute_local_bounding_sphere(&self) -> BoundingSphere
Source§fn compute_aabb(&self, position: &Isometry<f32>) -> Aabb
fn compute_aabb(&self, position: &Isometry<f32>) -> Aabb
Aabb of this shape with the given position.Source§fn mass_properties(&self, density: f32) -> MassProperties
fn mass_properties(&self, density: f32) -> MassProperties
Source§fn shape_type(&self) -> ShapeType
fn shape_type(&self) -> ShapeType
Source§fn as_typed_shape(&self) -> TypedShape<'_>
fn as_typed_shape(&self) -> TypedShape<'_>
fn ccd_thickness(&self) -> f32
fn ccd_angular_thickness(&self) -> f32
Source§fn as_support_map(&self) -> Option<&dyn SupportMap>
fn as_support_map(&self) -> Option<&dyn SupportMap>
Source§fn as_polygonal_feature_map(&self) -> Option<(&dyn PolygonalFeatureMap, f32)>
fn as_polygonal_feature_map(&self) -> Option<(&dyn PolygonalFeatureMap, f32)>
Source§fn clone_box(&self) -> Box<dyn Shape>
fn clone_box(&self) -> Box<dyn Shape>
clone_dynSource§fn compute_bounding_sphere(&self, position: &Isometry<f32>) -> BoundingSphere
fn compute_bounding_sphere(&self, position: &Isometry<f32>) -> BoundingSphere
fn as_composite_shape(&self) -> Option<&dyn CompositeShape>
Source§impl<S: SupportMap> SupportMap for RoundShape<S>
impl<S: SupportMap> SupportMap for RoundShape<S>
Source§fn local_support_point(&self, dir: &Vector<f32>) -> Point<f32>
fn local_support_point(&self, dir: &Vector<f32>) -> Point<f32>
Computes the support point of the rounded shape in the given direction.
The support point is the point on the shape’s surface that is furthest in the given direction. For a rounded shape, this is computed by:
- Finding the support point of the inner shape in the given direction
- Moving that point outward by
border_radiusunits along the direction
§Parameters
dir- The direction vector (will be normalized internally)
§Returns
The point on the rounded shape’s surface that is furthest in the given direction.
§Examples
use parry3d::shape::{RoundShape, Cuboid, SupportMap};
use parry3d_f64::shape::{RoundShape, Cuboid, SupportMap};
use nalgebra::Vector3;
let cuboid = Cuboid::new(Vector3::new(1.0, 1.0, 1.0));
let rounded = RoundShape {
inner_shape: cuboid,
border_radius: 0.5,
};
// Support point in the positive X direction
let dir = Vector3::new(1.0, 0.0, 0.0);
let support = rounded.local_support_point(&dir);
// The X coordinate is the cuboid's half-extent plus the border radius
assert!((support.x - 1.5).abs() < 1e-6);Source§fn local_support_point_toward(&self, dir: &Unit<Vector<f32>>) -> Point<f32>
fn local_support_point_toward(&self, dir: &Unit<Vector<f32>>) -> Point<f32>
Computes the support point of the rounded shape toward the given unit direction.
This is similar to local_support_point but takes a pre-normalized direction vector,
which can be more efficient when the direction is already normalized.
The implementation adds the border radius offset to the inner shape’s support point:
support_point = inner_support_point + direction * border_radius
§Parameters
dir- A unit-length direction vector
§Returns
The point on the rounded shape’s surface that is furthest in the given direction.
§Examples
use parry2d::shape::{RoundShape, Ball, SupportMap};
use parry2d_f64::shape::{RoundShape, Ball, SupportMap};
use nalgebra::{Vector2, Unit};
let ball = Ball::new(1.0);
let rounded = RoundShape {
inner_shape: ball,
border_radius: 0.3,
};
// Create a unit direction
let dir = Unit::new_normalize(Vector2::new(1.0, 1.0));
let support = rounded.local_support_point_toward(&dir);
// The distance from origin should be ball radius + border radius
let distance = (support.x.powi(2) + support.y.powi(2)).sqrt();
assert!((distance - 1.3).abs() < 1e-6);impl<S: Copy> Copy for RoundShape<S>
Auto Trait Implementations§
impl<S> Freeze for RoundShape<S>where
S: Freeze,
impl<S> RefUnwindSafe for RoundShape<S>where
S: RefUnwindSafe,
impl<S> Send for RoundShape<S>where
S: Send,
impl<S> Sync for RoundShape<S>where
S: Sync,
impl<S> Unpin for RoundShape<S>where
S: Unpin,
impl<S> UnwindSafe for RoundShape<S>where
S: UnwindSafe,
Blanket Implementations§
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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<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<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.