#[repr(C)]pub struct Aabb {
pub mins: Point<f32>,
pub maxs: Point<f32>,
}Expand description
An Axis-Aligned Bounding Box (AABB).
An AABB is the simplest bounding volume, defined by its minimum and maximum corners. It’s called “axis-aligned” because its edges are always parallel to the coordinate axes (X, Y, and Z in 3D), making it very fast to test and compute.
§Structure
- mins: The point with the smallest coordinates on each axis (bottom-left-back corner)
- maxs: The point with the largest coordinates on each axis (top-right-front corner)
- Invariant:
mins.x ≤ maxs.x,mins.y ≤ maxs.y(andmins.z ≤ maxs.zin 3D)
§Properties
- Axis-aligned: Edges always parallel to coordinate axes
- Conservative: May be larger than the actual shape for rotated objects
- Fast: Intersection tests are very cheap (just coordinate comparisons)
- Hierarchical: Perfect for spatial data structures (BVH, quadtree, octree)
§Use Cases
AABBs are fundamental to collision detection and are used for:
- Broad-phase collision detection: Quickly eliminate distant object pairs
- Spatial partitioning: Building BVHs, quadtrees, and octrees
- View frustum culling: Determining what’s visible
- Ray tracing acceleration: Quickly rejecting non-intersecting rays
- Bounding volume for any shape: Every shape can compute its AABB
§Performance
AABBs are the fastest bounding volume for:
- Intersection tests: O(1) with just 6 comparisons (3D)
- Merging: O(1) with component-wise min/max
- Contains test: O(1) with coordinate comparisons
§Limitations
- Rotation invariance: Must be recomputed when objects rotate
- Tightness: May waste space for rotated or complex shapes
- No orientation: Cannot represent oriented bounding boxes (OBB)
§Example
use parry3d::bounding_volume::Aabb;
use nalgebra::Point3;
// Create an AABB for a unit cube centered at origin
let mins = Point3::new(-0.5, -0.5, -0.5);
let maxs = Point3::new(0.5, 0.5, 0.5);
let aabb = Aabb::new(mins, maxs);
// Check if a point is inside
let point = Point3::origin();
assert!(aabb.contains_local_point(&point));
// Get center and extents
assert_eq!(aabb.center(), Point3::origin());
assert_eq!(aabb.extents().x, 1.0); // Full width
assert_eq!(aabb.half_extents().x, 0.5); // Half widthuse parry3d::bounding_volume::Aabb;
use nalgebra::Point3;
// Create from a set of points
let points = vec![
Point3::new(1.0, 2.0, 3.0),
Point3::new(-1.0, 4.0, 2.0),
Point3::new(0.0, 0.0, 5.0),
];
let aabb = Aabb::from_points(points);
// The AABB encloses all points
assert_eq!(aabb.mins, Point3::new(-1.0, 0.0, 2.0));
assert_eq!(aabb.maxs, Point3::new(1.0, 4.0, 5.0));Fields§
§mins: Point<f32>The point with minimum coordinates (bottom-left-back corner).
Each component (x, y, z) should be less than or equal to the
corresponding component in maxs.
maxs: Point<f32>The point with maximum coordinates (top-right-front corner).
Each component (x, y, z) should be greater than or equal to the
corresponding component in mins.
Implementations§
Source§impl Aabb
impl Aabb
Sourcepub const EDGES_VERTEX_IDS: [(usize, usize); 12]
pub const EDGES_VERTEX_IDS: [(usize, usize); 12]
The vertex indices of each edge of this Aabb.
This gives, for each edge of this Aabb, the indices of its
vertices when taken from the self.vertices() array.
Here is how the faces are numbered, assuming
a right-handed coordinate system:
y 3 - 2
| 7 − 6 |
___ x | | 1 (the zero is below 3 and on the left of 1,
/ 4 - 5 hidden by the 4-5-6-7 face.)
zSourcepub const FACES_VERTEX_IDS: [(usize, usize, usize, usize); 6]
pub const FACES_VERTEX_IDS: [(usize, usize, usize, usize); 6]
The vertex indices of each face of this Aabb.
This gives, for each face of this Aabb, the indices of its
vertices when taken from the self.vertices() array.
Here is how the faces are numbered, assuming
a right-handed coordinate system:
y 3 - 2
| 7 − 6 |
___ x | | 1 (the zero is below 3 and on the left of 1,
/ 4 - 5 hidden by the 4-5-6-7 face.)
zSourcepub fn new(mins: Point<f32>, maxs: Point<f32>) -> Aabb
pub fn new(mins: Point<f32>, maxs: Point<f32>) -> Aabb
Creates a new AABB from its minimum and maximum corners.
§Arguments
mins- The point with the smallest coordinates on each axismaxs- The point with the largest coordinates on each axis
§Invariant
Each component of mins should be ≤ the corresponding component of maxs.
§Example
use parry3d::bounding_volume::Aabb;
use nalgebra::Point3;
// Create a 2x2x2 cube centered at origin
let aabb = Aabb::new(
Point3::new(-1.0, -1.0, -1.0),
Point3::new(1.0, 1.0, 1.0)
);
assert_eq!(aabb.center(), Point3::origin());
assert_eq!(aabb.extents(), nalgebra::Vector3::new(2.0, 2.0, 2.0));Sourcepub fn new_invalid() -> Self
pub fn new_invalid() -> Self
Creates an invalid AABB with inverted bounds.
The resulting AABB has mins set to maximum values and maxs set to
minimum values. This is useful as an initial value for AABB merging
algorithms (similar to starting a min operation with infinity).
§Example
use parry3d::bounding_volume::{Aabb, BoundingVolume};
use nalgebra::Point3;
let mut aabb = Aabb::new_invalid();
// Merge with actual points to build proper AABB
aabb.merge(&Aabb::new(Point3::new(1.0, 2.0, 3.0), Point3::new(1.0, 2.0, 3.0)));
aabb.merge(&Aabb::new(Point3::new(-1.0, 0.0, 2.0), Point3::new(-1.0, 0.0, 2.0)));
// Now contains the merged bounds
assert_eq!(aabb.mins, Point3::new(-1.0, 0.0, 2.0));
assert_eq!(aabb.maxs, Point3::new(1.0, 2.0, 3.0));Sourcepub fn from_half_extents(center: Point<f32>, half_extents: Vector<f32>) -> Self
pub fn from_half_extents(center: Point<f32>, half_extents: Vector<f32>) -> Self
Creates a new AABB from its center and half-extents.
This is often more intuitive than specifying min and max corners.
§Arguments
center- The center point of the AABBhalf_extents- Half the dimensions along each axis
§Example
use parry3d::bounding_volume::Aabb;
use nalgebra::{Point3, Vector3};
// Create a 10x6x8 box centered at (5, 0, 0)
let aabb = Aabb::from_half_extents(
Point3::new(5.0, 0.0, 0.0),
Vector3::new(5.0, 3.0, 4.0)
);
assert_eq!(aabb.mins, Point3::new(0.0, -3.0, -4.0));
assert_eq!(aabb.maxs, Point3::new(10.0, 3.0, 4.0));
assert_eq!(aabb.center(), Point3::new(5.0, 0.0, 0.0));Sourcepub fn from_points_ref<'a, I>(pts: I) -> Self
pub fn from_points_ref<'a, I>(pts: I) -> Self
Creates a new AABB that tightly encloses a set of points (references).
Computes the minimum and maximum coordinates across all points.
§Arguments
pts- An iterator over point references
§Example
use parry3d::bounding_volume::Aabb;
use nalgebra::Point3;
let points = vec![
Point3::new(1.0, 2.0, 3.0),
Point3::new(-1.0, 4.0, 2.0),
Point3::new(0.0, 0.0, 5.0),
];
let aabb = Aabb::from_points_ref(&points);
assert_eq!(aabb.mins, Point3::new(-1.0, 0.0, 2.0));
assert_eq!(aabb.maxs, Point3::new(1.0, 4.0, 5.0));Sourcepub fn from_points<I>(pts: I) -> Self
pub fn from_points<I>(pts: I) -> Self
Creates a new AABB that tightly encloses a set of points (values).
Computes the minimum and maximum coordinates across all points.
§Arguments
pts- An iterator over point values
§Example
use parry3d::bounding_volume::Aabb;
use nalgebra::Point3;
let aabb = Aabb::from_points(vec![
Point3::new(1.0, 2.0, 3.0),
Point3::new(-1.0, 4.0, 2.0),
Point3::new(0.0, 0.0, 5.0),
]);
assert_eq!(aabb.mins, Point3::new(-1.0, 0.0, 2.0));
assert_eq!(aabb.maxs, Point3::new(1.0, 4.0, 5.0));Sourcepub fn center(&self) -> Point<f32>
pub fn center(&self) -> Point<f32>
Returns the center point of this AABB.
The center is the midpoint between mins and maxs.
§Example
use parry3d::bounding_volume::Aabb;
use nalgebra::Point3;
let aabb = Aabb::new(
Point3::new(-2.0, -3.0, -4.0),
Point3::new(2.0, 3.0, 4.0)
);
assert_eq!(aabb.center(), Point3::origin());Sourcepub fn half_extents(&self) -> Vector<f32>
pub fn half_extents(&self) -> Vector<f32>
Returns the half-extents of this AABB.
Half-extents are half the dimensions along each axis.
§Example
use parry3d::bounding_volume::Aabb;
use nalgebra::{Point3, Vector3};
let aabb = Aabb::new(
Point3::new(-5.0, -3.0, -2.0),
Point3::new(5.0, 3.0, 2.0)
);
let half = aabb.half_extents();
assert_eq!(half, Vector3::new(5.0, 3.0, 2.0));
// Full dimensions are 2 * half_extents
let full = aabb.extents();
assert_eq!(full, Vector3::new(10.0, 6.0, 4.0));Sourcepub fn volume(&self) -> f32
pub fn volume(&self) -> f32
Returns the volume of this AABB.
- 2D: Returns the area (width × height)
- 3D: Returns the volume (width × height × depth)
§Example
use parry3d::bounding_volume::Aabb;
use nalgebra::Point3;
// A 2x3x4 box
let aabb = Aabb::new(
Point3::origin(),
Point3::new(2.0, 3.0, 4.0)
);
assert_eq!(aabb.volume(), 24.0); // 2 * 3 * 4Sourcepub fn half_area_or_perimeter(&self) -> f32
pub fn half_area_or_perimeter(&self) -> f32
In 3D, returns the half-area. In 2D returns the half-perimeter of the AABB.
Sourcepub fn take_point(&mut self, pt: Point<f32>)
pub fn take_point(&mut self, pt: Point<f32>)
Enlarges this Aabb so it also contains the point pt.
Sourcepub fn transform_by(&self, m: &Isometry<f32>) -> Self
pub fn transform_by(&self, m: &Isometry<f32>) -> Self
Computes the Aabb bounding self transformed by m.
Sourcepub fn translated(self, translation: &Vector<f32>) -> Self
pub fn translated(self, translation: &Vector<f32>) -> Self
Computes the Aabb bounding self translated by translation.
pub fn scaled(self, scale: &Vector<f32>) -> Self
Sourcepub fn scaled_wrt_center(self, scale: &Vector<f32>) -> Self
pub fn scaled_wrt_center(self, scale: &Vector<f32>) -> Self
Returns an AABB with the same center as self but with extents scaled by scale.
§Parameters
scale: the scaling factor. It can be non-uniform and/or negative. The AABB being symmetric wrt. its center, a negative scale value has the same effect as scaling by its absolute value.
Sourcepub fn bounding_sphere(&self) -> BoundingSphere
pub fn bounding_sphere(&self) -> BoundingSphere
The smallest bounding sphere containing this Aabb.
Sourcepub fn contains_local_point(&self, point: &Point<f32>) -> bool
pub fn contains_local_point(&self, point: &Point<f32>) -> bool
Does this AABB contains a point expressed in the same coordinate frame as self?
Sourcepub fn distance_to_origin(&self) -> f32
pub fn distance_to_origin(&self) -> f32
Computes the distance between the origin and this AABB.
Sourcepub fn intersects_moving_aabb(&self, aabb2: &Self, vel12: Vector<f32>) -> bool
pub fn intersects_moving_aabb(&self, aabb2: &Self, vel12: Vector<f32>) -> bool
Does this AABB intersects an AABB aabb2 moving at velocity vel12 relative to self?
Sourcepub fn intersection(&self, other: &Aabb) -> Option<Aabb>
pub fn intersection(&self, other: &Aabb) -> Option<Aabb>
Computes the intersection of this Aabb and another one.
Sourcepub fn aligned_intersections(
&self,
pos12: &Isometry<f32>,
aabb2: &Self,
) -> Option<(Aabb, Aabb)>
pub fn aligned_intersections( &self, pos12: &Isometry<f32>, aabb2: &Self, ) -> Option<(Aabb, Aabb)>
Computes two AABBs for the intersection between two translated and rotated AABBs.
This method returns two AABBs: the first is expressed in the local-space of self,
and the second is expressed in the local-space of aabb2.
Sourcepub fn difference(&self, rhs: &Aabb) -> ArrayVec<Self, TWO_DIM>
pub fn difference(&self, rhs: &Aabb) -> ArrayVec<Self, TWO_DIM>
Returns the difference between this Aabb and rhs.
Removing another Aabb from self will result in zero, one, or up to 4 (in 2D) or 8 (in 3D)
new smaller Aabbs.
Sourcepub fn difference_with_cut_sequence(
&self,
rhs: &Aabb,
) -> (ArrayVec<Self, TWO_DIM>, ArrayVec<(i8, f32), TWO_DIM>)
pub fn difference_with_cut_sequence( &self, rhs: &Aabb, ) -> (ArrayVec<Self, TWO_DIM>, ArrayVec<(i8, f32), TWO_DIM>)
Returns the difference between this Aabb and rhs.
Removing another Aabb from self will result in zero, one, or up to 4 (in 2D) or 8 (in 3D)
new smaller Aabbs.
§Return
This returns a pair where the first item are the new Aabbs and the second item is
the sequence of cuts applied to self to obtain the new Aabbs. Each cut is performed
along one axis identified by -1, -2, -3 for -X, -Y, -Z and 1, 2, 3 for +X, +Y, +Z, and
the plane’s bias.
The cuts are applied sequentially. For example, if result.1[0] contains 1, then it means
that result.0[0] is equal to the piece of self lying in the negative half-space delimited
by the plane with outward normal +X. Then, the other piece of self generated by this cut
(i.e. the piece of self lying in the positive half-space delimited by the plane with outward
normal +X) is the one that will be affected by the next cut.
The returned cut sequence will be empty if the aabbs are disjoint.
Sourcepub fn vertices(&self) -> [Point<f32>; 8]
pub fn vertices(&self) -> [Point<f32>; 8]
Computes the vertices of this Aabb.
The vertices are given in the following order, in a right-handed coordinate system:
y 3 - 2
| 7 − 6 |
___ x | | 1 (the zero is below 3 and on the left of 1,
/ 4 - 5 hidden by the 4-5-6-7 face.)
zSourcepub fn split_at_center(&self) -> [Aabb; 8]
pub fn split_at_center(&self) -> [Aabb; 8]
Splits this Aabb at its center, into eight parts (as in an octree).
Sourcepub fn add_half_extents(&self, half_extents: &Vector<f32>) -> Self
pub fn add_half_extents(&self, half_extents: &Vector<f32>) -> Self
Enlarges this AABB on each side by the given half_extents.
Sourcepub fn project_on_axis(&self, axis: &UnitVector<f32>) -> (f32, f32)
pub fn project_on_axis(&self, axis: &UnitVector<f32>) -> (f32, f32)
Projects every point of Aabb on an arbitrary axis.
pub fn intersects_spiral( &self, point: &Point<f32>, center: &Point<f32>, axis: &UnitVector<f32>, linvel: &Vector<f32>, angvel: f32, ) -> bool
Source§impl Aabb
impl Aabb
Sourcepub fn clip_segment(&self, pa: &Point<f32>, pb: &Point<f32>) -> Option<Segment>
pub fn clip_segment(&self, pa: &Point<f32>, pb: &Point<f32>) -> Option<Segment>
Computes the intersection of a segment with this Aabb.
Returns None if there is no intersection or if pa is invalid (contains NaN).
Sourcepub fn clip_line_parameters(
&self,
orig: &Point<f32>,
dir: &Vector<f32>,
) -> Option<(f32, f32)>
pub fn clip_line_parameters( &self, orig: &Point<f32>, dir: &Vector<f32>, ) -> Option<(f32, f32)>
Computes the parameters of the two intersection points between a line and this Aabb.
The parameters are such that the point are given by orig + dir * parameter.
Returns None if there is no intersection or if orig is invalid (contains NaN).
Sourcepub fn clip_line(&self, orig: &Point<f32>, dir: &Vector<f32>) -> Option<Segment>
pub fn clip_line(&self, orig: &Point<f32>, dir: &Vector<f32>) -> Option<Segment>
Computes the intersection segment between a line and this Aabb.
Returns None if there is no intersection or if orig is invalid (contains NaN).
Sourcepub fn clip_ray_parameters(&self, ray: &Ray) -> Option<(f32, f32)>
pub fn clip_ray_parameters(&self, ray: &Ray) -> Option<(f32, f32)>
Computes the parameters of the two intersection points between a ray and this Aabb.
The parameters are such that the point are given by ray.orig + ray.dir * parameter.
Returns None if there is no intersection or if ray.orig is invalid (contains NaN).
Source§impl Aabb
impl Aabb
Sourcepub fn clip_polygon(&self, points: &mut Vec<Point<f32>>)
pub fn clip_polygon(&self, points: &mut Vec<Point<f32>>)
Computes the intersections between this Aabb and the given polygon.
The results is written into points directly. The input points are
assumed to form a convex polygon where all points lie on the same plane.
In order to avoid internal allocations, uses self.clip_polygon_with_workspace
instead.
Sourcepub fn clip_polygon_with_workspace(
&self,
points: &mut Vec<Point<f32>>,
workspace: &mut Vec<Point<f32>>,
)
pub fn clip_polygon_with_workspace( &self, points: &mut Vec<Point<f32>>, workspace: &mut Vec<Point<f32>>, )
Computes the intersections between this Aabb and the given polygon.
The results is written into points directly. The input points are
assumed to form a convex polygon where all points lie on the same plane.
Source§impl Aabb
impl Aabb
Sourcepub fn canonical_split(
&self,
axis: usize,
bias: f32,
epsilon: f32,
) -> SplitResult<Self>
pub fn canonical_split( &self, axis: usize, bias: f32, epsilon: f32, ) -> SplitResult<Self>
Splits this Aabb along the given canonical axis.
This will split the Aabb by a plane with a normal with it’s axis-th component set to 1.
The splitting plane is shifted wrt. the origin by the bias (i.e. it passes through the point
equal to normal * bias).
§Result
Returns the result of the split. The first Aabb returned is the piece lying on the negative
half-space delimited by the splitting plane. The second Aabb returned is the piece lying on the
positive half-space delimited by the splitting plane.
Trait Implementations§
Source§impl BoundingVolume for Aabb
impl BoundingVolume for Aabb
Source§fn center(&self) -> Point<f32>
fn center(&self) -> Point<f32>
Source§fn intersects(&self, other: &Aabb) -> bool
fn intersects(&self, other: &Aabb) -> bool
Source§fn merge(&mut self, other: &Aabb)
fn merge(&mut self, other: &Aabb)
Source§impl PointQuery for Aabb
impl PointQuery for Aabb
Source§fn project_local_point(&self, pt: &Point<f32>, solid: bool) -> PointProjection
fn project_local_point(&self, pt: &Point<f32>, solid: bool) -> PointProjection
self. Read moreSource§fn project_local_point_and_get_feature(
&self,
pt: &Point<f32>,
) -> (PointProjection, FeatureId)
fn project_local_point_and_get_feature( &self, pt: &Point<f32>, ) -> (PointProjection, FeatureId)
self and returns the id of the
feature the point was projected on.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 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 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 RayCast for Aabb
impl RayCast for Aabb
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 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 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>
impl Copy for Aabb
impl StructuralPartialEq for Aabb
Auto Trait Implementations§
impl Freeze for Aabb
impl RefUnwindSafe for Aabb
impl Send for Aabb
impl Sync for Aabb
impl Unpin for Aabb
impl UnwindSafe for Aabb
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.