Struct avian3d::spatial_query::SpatialQuery

source ·
pub struct SpatialQuery<'w, 's> {
    pub query_pipeline: ResMut<'w, SpatialQueryPipeline>,
    /* private fields */
}
Expand description

A system parameter for performing spatial queries.

§Methods

For simple raycasts and shapecasts, consider using the RayCaster and ShapeCaster components that provide a more ECS-based approach and perform casts on every frame.

§Raycasting example

use avian3d::prelude::*;
use bevy::prelude::*;

fn print_hits(spatial_query: SpatialQuery) {
    // Cast ray and print first hit
    if let Some(first_hit) = spatial_query.cast_ray(
        Vec3::ZERO,                    // Origin
        Dir3::X,                       // Direction
        100.0,                         // Maximum time of impact (travel distance)
        true,                          // Does the ray treat colliders as "solid"
        SpatialQueryFilter::default(), // Query filter
    ) {
        println!("First hit: {:?}", first_hit);
    }

    // Cast ray and get up to 20 hits
    let hits = spatial_query.ray_hits(
        Vec3::ZERO,                    // Origin
        Dir3::X,                       // Direction
        100.0,                         // Maximum time of impact (travel distance)
        20,                            // Maximum number of hits
        true,                          // Does the ray treat colliders as "solid"
        SpatialQueryFilter::default(), // Query filter
    );

    // Print hits
    for hit in hits.iter() {
        println!("Hit: {:?}", hit);
    }
}

Fields§

§query_pipeline: ResMut<'w, SpatialQueryPipeline>

Implementations§

source§

impl<'w, 's> SpatialQuery<'w, 's>

source

pub fn update_pipeline(&mut self)

Updates the colliders in the pipeline. This is done automatically once per physics frame in PhysicsStepSet::SpatialQuery, but if you modify colliders or their positions before that, you can call this to make sure the data is up to date when performing spatial queries using SpatialQuery.

source

pub fn cast_ray( &self, origin: Vector, direction: Dir3, max_time_of_impact: Scalar, solid: bool, query_filter: SpatialQueryFilter ) -> Option<RayHitData>

Casts a ray and computes the closest hit with a collider. If there are no hits, None is returned.

§Arguments
  • origin: Where the ray is cast from.
  • direction: What direction the ray is cast in.
  • max_time_of_impact: The maximum distance that the ray can travel.
  • solid: If true and the ray origin is inside of a collider, the hit point will be the ray origin itself. Otherwise, the collider will be treated as hollow, and the hit point will be at the collider’s boundary.
  • query_filter: A SpatialQueryFilter that determines which colliders are taken into account in the query.
§Example
use avian3d::prelude::*;
use bevy::prelude::*;

fn print_hits(spatial_query: SpatialQuery) {
    // Cast ray and print first hit
    if let Some(first_hit) = spatial_query.cast_ray(
        Vec3::ZERO,                    // Origin
        Dir3::X,                       // Direction
        100.0,                         // Maximum time of impact (travel distance)
        true,                          // Does the ray treat colliders as "solid"
        SpatialQueryFilter::default(), // Query filter
    ) {
        println!("First hit: {:?}", first_hit);
    }
}
source

pub fn cast_ray_predicate( &self, origin: Vector, direction: Dir3, max_time_of_impact: Scalar, solid: bool, query_filter: SpatialQueryFilter, predicate: &dyn Fn(Entity) -> bool ) -> Option<RayHitData>

Casts a ray and computes the closest hit with a collider. If there are no hits, None is returned.

§Arguments
  • origin: Where the ray is cast from.
  • direction: What direction the ray is cast in.
  • max_time_of_impact: The maximum distance that the ray can travel.
  • solid: If true and the ray origin is inside of a collider, the hit point will be the ray origin itself. Otherwise, the collider will be treated as hollow, and the hit point will be at the collider’s boundary.
  • query_filter: A SpatialQueryFilter that determines which colliders are taken into account in the query.
  • predicate: A function with which the colliders are filtered. Given the Entity it should return false, if the entity should be ignored.
§Example
use avian3d::prelude::*;
use bevy::prelude::*;

#[derive(Component)]
struct Invisible;

fn print_hits(spatial_query: SpatialQuery, query: Query<&Invisible>) {
    // Cast ray and print first hit
    if let Some(first_hit) = spatial_query.cast_ray_predicate(
        Vec3::ZERO,                    // Origin
        Dir3::X,                       // Direction
        100.0,                         // Maximum time of impact (travel distance)
        true,                          // Does the ray treat colliders as "solid"
        SpatialQueryFilter::default(), // Query filter
        &|entity| {                    // Predicate
            // Skip entities with the `Invisible` component.
            !query.contains(entity)
        }
    ) {
        println!("First hit: {:?}", first_hit);
    }
}
source

pub fn ray_hits( &self, origin: Vector, direction: Dir3, max_time_of_impact: Scalar, max_hits: u32, solid: bool, query_filter: SpatialQueryFilter ) -> Vec<RayHitData>

Casts a ray and computes all hits until max_hits is reached.

Note that the order of the results is not guaranteed, and if there are more hits than max_hits, some hits will be missed.

§Arguments
  • origin: Where the ray is cast from.
  • direction: What direction the ray is cast in.
  • max_time_of_impact: The maximum distance that the ray can travel.
  • max_hits: The maximum number of hits. Additional hits will be missed.
  • solid: If true and the ray origin is inside of a collider, the hit point will be the ray origin itself. Otherwise, the collider will be treated as hollow, and the hit point will be at the collider’s boundary.
  • query_filter: A SpatialQueryFilter that determines which colliders are taken into account in the query.
§Example
use avian3d::prelude::*;
use bevy::prelude::*;

fn print_hits(spatial_query: SpatialQuery) {
    // Cast ray and get hits
    let hits = spatial_query.ray_hits(
        Vec3::ZERO,                    // Origin
        Dir3::X,                       // Direction
        100.0,                         // Maximum time of impact (travel distance)
        20,                            // Maximum number of hits
        true,                          // Does the ray treat colliders as "solid"
        SpatialQueryFilter::default(), // Query filter
    );

    // Print hits
    for hit in hits.iter() {
        println!("Hit: {:?}", hit);
    }
}
source

pub fn ray_hits_callback( &self, origin: Vector, direction: Dir3, max_time_of_impact: Scalar, solid: bool, query_filter: SpatialQueryFilter, callback: impl FnMut(RayHitData) -> bool )

Casts a ray and computes all hits, calling the given callback for each hit. The raycast stops when callback returns false or all hits have been found.

Note that the order of the results is not guaranteed.

§Arguments
  • origin: Where the ray is cast from.
  • direction: What direction the ray is cast in.
  • max_time_of_impact: The maximum distance that the ray can travel.
  • solid: If true and the ray origin is inside of a collider, the hit point will be the ray origin itself. Otherwise, the collider will be treated as hollow, and the hit point will be at the collider’s boundary.
  • query_filter: A SpatialQueryFilter that determines which colliders are taken into account in the query.
  • callback: A callback function called for each hit.
§Example
use avian3d::prelude::*;
use bevy::prelude::*;

fn print_hits(spatial_query: SpatialQuery) {
    let mut hits = vec![];

    // Cast ray and get all hits
    spatial_query.ray_hits_callback(
        Vec3::ZERO,                    // Origin
        Dir3::X,                       // Direction
        100.0,                         // Maximum time of impact (travel distance)
        true,                          // Does the ray treat colliders as "solid"
        SpatialQueryFilter::default(), // Query filter
        |hit| {                        // Callback function
            hits.push(hit);
            true
        },
    );

    // Print hits
    for hit in hits.iter() {
        println!("Hit: {:?}", hit);
    }
}
source

pub fn cast_shape( &self, shape: &Collider, origin: Vector, shape_rotation: Quaternion, direction: Dir3, max_time_of_impact: Scalar, ignore_origin_penetration: bool, query_filter: SpatialQueryFilter ) -> Option<ShapeHitData>

Casts a shape with a given rotation and computes the closest hit with a collider. If there are no hits, None is returned.

For a more ECS-based approach, consider using the ShapeCaster component instead.

§Arguments
  • shape: The shape being cast represented as a Collider.
  • origin: Where the shape is cast from.
  • shape_rotation: The rotation of the shape being cast.
  • direction: What direction the shape is cast in.
  • max_time_of_impact: The maximum distance that the shape can travel.
  • ignore_origin_penetration: If true and the shape is already penetrating a collider at the shape origin, the hit will be ignored and only the next hit will be computed. Otherwise, the initial hit will be returned.
  • query_filter: A SpatialQueryFilter that determines which colliders are taken into account in the query.
§Example
use avian3d::prelude::*;
use bevy::prelude::*;

fn print_hits(spatial_query: SpatialQuery) {
    // Cast ray and print first hit
    if let Some(first_hit) = spatial_query.cast_shape(
        &Collider::sphere(0.5),          // Shape
        Vec3::ZERO,                      // Origin
        Quat::default(),                 // Shape rotation
        Dir3::X,                         // Direction
        100.0,                           // Maximum time of impact (travel distance)
        true,                            // Should initial penetration at the origin be ignored
        SpatialQueryFilter::default(),   // Query filter
    ) {
        println!("First hit: {:?}", first_hit);
    }
}
source

pub fn shape_hits( &self, shape: &Collider, origin: Vector, shape_rotation: Quaternion, direction: Dir3, max_time_of_impact: Scalar, max_hits: u32, ignore_origin_penetration: bool, query_filter: SpatialQueryFilter ) -> Vec<ShapeHitData>

Casts a shape with a given rotation and computes computes all hits in the order of the time of impact until max_hits is reached.

§Arguments
  • shape: The shape being cast represented as a Collider.
  • origin: Where the shape is cast from.
  • shape_rotation: The rotation of the shape being cast.
  • direction: What direction the shape is cast in.
  • max_time_of_impact: The maximum distance that the shape can travel.
  • max_hits: The maximum number of hits. Additional hits will be missed.
  • ignore_origin_penetration: If true and the shape is already penetrating a collider at the shape origin, the hit will be ignored and only the next hit will be computed. Otherwise, the initial hit will be returned.
  • query_filter: A SpatialQueryFilter that determines which colliders are taken into account in the query.
  • callback: A callback function called for each hit.
§Example
use avian3d::prelude::*;
use bevy::prelude::*;

fn print_hits(spatial_query: SpatialQuery) {
    // Cast shape and get all hits
    let hits = spatial_query.shape_hits(
        &Collider::sphere(0.5),          // Shape
        Vec3::ZERO,                      // Origin
        Quat::default(),                 // Shape rotation
        Dir3::X,                         // Direction
        100.0,                           // Maximum time of impact (travel distance)
        20,                              // Max hits
        true,                            // Should initial penetration at the origin be ignored
        SpatialQueryFilter::default(),   // Query filter
    );

    // Print hits
    for hit in hits.iter() {
        println!("Hit: {:?}", hit);
    }
}
source

pub fn shape_hits_callback( &self, shape: &Collider, origin: Vector, shape_rotation: Quaternion, direction: Dir3, max_time_of_impact: Scalar, ignore_origin_penetration: bool, query_filter: SpatialQueryFilter, callback: impl FnMut(ShapeHitData) -> bool )

Casts a shape with a given rotation and computes computes all hits in the order of the time of impact, calling the given callback for each hit. The shapecast stops when callback returns false or all hits have been found.

§Arguments
  • shape: The shape being cast represented as a Collider.
  • origin: Where the shape is cast from.
  • shape_rotation: The rotation of the shape being cast.
  • direction: What direction the shape is cast in.
  • max_time_of_impact: The maximum distance that the shape can travel.
  • ignore_origin_penetration: If true and the shape is already penetrating a collider at the shape origin, the hit will be ignored and only the next hit will be computed. Otherwise, the initial hit will be returned.
  • query_filter: A SpatialQueryFilter that determines which colliders are taken into account in the query.
  • callback: A callback function called for each hit.
§Example
use avian3d::prelude::*;
use bevy::prelude::*;

fn print_hits(spatial_query: SpatialQuery) {
    let mut hits = vec![];

    // Cast shape and get all hits
    spatial_query.shape_hits_callback(
        &Collider::sphere(0.5),          // Shape
        Vec3::ZERO,                      // Origin
        Quat::default(),                 // Shape rotation
        Dir3::X,                         // Direction
        100.0,                           // Maximum time of impact (travel distance)
        true,                            // Should initial penetration at the origin be ignored
        SpatialQueryFilter::default(),   // Query filter
        |hit| {                          // Callback function
            hits.push(hit);
            true
        },
    );

    // Print hits
    for hit in hits.iter() {
        println!("Hit: {:?}", hit);
    }
}
source

pub fn project_point( &self, point: Vector, solid: bool, query_filter: SpatialQueryFilter ) -> Option<PointProjection>

Finds the projection of a given point on the closest collider. If one isn’t found, None is returned.

§Arguments
  • point: The point that should be projected.
  • solid: If true and the point is inside of a collider, the projection will be at the point. Otherwise, the collider will be treated as hollow, and the projection will be at the collider’s boundary.
  • query_filter: A SpatialQueryFilter that determines which colliders are taken into account in the query.
§Example
use avian3d::prelude::*;
use bevy::prelude::*;

fn print_point_projection(spatial_query: SpatialQuery) {
    // Project a point and print the result
    if let Some(projection) = spatial_query.project_point(
        Vec3::ZERO,                    // Point
        true,                          // Are colliders treated as "solid"
        SpatialQueryFilter::default(), // Query filter
    ) {
        println!("Projection: {:?}", projection);
    }
}
source

pub fn point_intersections( &self, point: Vector, query_filter: SpatialQueryFilter ) -> Vec<Entity>

An intersection test that finds all entities with a collider that contains the given point.

§Arguments
  • point: The point that intersections are tested against.
  • query_filter: A SpatialQueryFilter that determines which colliders are taken into account in the query.
§Example
use avian3d::prelude::*;
use bevy::prelude::*;

fn print_point_intersections(spatial_query: SpatialQuery) {
    let intersections =
        spatial_query.point_intersections(Vec3::ZERO, SpatialQueryFilter::default());

    for entity in intersections.iter() {
        println!("Entity: {:?}", entity);
    }
}
source

pub fn point_intersections_callback( &self, point: Vector, query_filter: SpatialQueryFilter, callback: impl FnMut(Entity) -> bool )

An intersection test that finds all entities with a collider that contains the given point, calling the given callback for each intersection. The search stops when callback returns false or all intersections have been found.

§Arguments
  • point: The point that intersections are tested against.
  • query_filter: A SpatialQueryFilter that determines which colliders are taken into account in the query.
  • callback: A callback function called for each intersection.
§Example
use avian3d::prelude::*;
use bevy::prelude::*;

fn print_point_intersections(spatial_query: SpatialQuery) {
    let mut intersections = vec![];
     
    spatial_query.point_intersections_callback(
        Vec3::ZERO,                     // Point
        SpatialQueryFilter::default(),  // Query filter
        |entity| {                      // Callback function
            intersections.push(entity);
            true
        },
    );

    for entity in intersections.iter() {
        println!("Entity: {:?}", entity);
    }
}
source

pub fn aabb_intersections_with_aabb(&self, aabb: ColliderAabb) -> Vec<Entity>

An intersection test that finds all entities with a ColliderAabb that is intersecting the given aabb.

§Example
use avian3d::prelude::*;
use bevy::prelude::*;

fn print_aabb_intersections(spatial_query: SpatialQuery) {
    let aabb = Collider::sphere(0.5).aabb(Vec3::ZERO, Quat::default());
    let intersections = spatial_query.aabb_intersections_with_aabb(aabb);

    for entity in intersections.iter() {
        println!("Entity: {:?}", entity);
    }
}
source

pub fn aabb_intersections_with_aabb_callback( &self, aabb: ColliderAabb, callback: impl FnMut(Entity) -> bool )

An intersection test that finds all entities with a ColliderAabb that is intersecting the given aabb, calling callback for each intersection. The search stops when callback returns false or all intersections have been found.

§Example
use avian3d::prelude::*;
use bevy::prelude::*;

fn print_aabb_intersections(spatial_query: SpatialQuery) {
    let mut intersections = vec![];

    spatial_query.aabb_intersections_with_aabb_callback(
        Collider::sphere(0.5).aabb(Vec3::ZERO, Quat::default()),
        |entity| {
            intersections.push(entity);
            true
        }
    );

    for entity in intersections.iter() {
        println!("Entity: {:?}", entity);
    }
}
source

pub fn shape_intersections( &self, shape: &Collider, shape_position: Vector, shape_rotation: Quaternion, query_filter: SpatialQueryFilter ) -> Vec<Entity>

An intersection test that finds all entities with a Collider that is intersecting the given shape with a given position and rotation.

§Arguments
  • shape: The shape that intersections are tested against represented as a Collider.
  • shape_position: The position of the shape.
  • shape_rotation: The rotation of the shape.
  • query_filter: A SpatialQueryFilter that determines which colliders are taken into account in the query.
§Example
use avian3d::prelude::*;
use bevy::prelude::*;

fn print_shape_intersections(spatial_query: SpatialQuery) {
    let intersections = spatial_query.shape_intersections(
        &Collider::sphere(0.5),          // Shape
        Vec3::ZERO,                      // Shape position
        Quat::default(),                 // Shape rotation
        SpatialQueryFilter::default(),   // Query filter
    );

    for entity in intersections.iter() {
        println!("Entity: {:?}", entity);
    }
}
source

pub fn shape_intersections_callback( &self, shape: &Collider, shape_position: Vector, shape_rotation: Quaternion, query_filter: SpatialQueryFilter, callback: impl FnMut(Entity) -> bool )

An intersection test that finds all entities with a Collider that is intersecting the given shape with a given position and rotation, calling callback for each intersection. The search stops when callback returns false or all intersections have been found.

§Arguments
  • shape: The shape that intersections are tested against represented as a Collider.
  • shape_position: The position of the shape.
  • shape_rotation: The rotation of the shape.
  • query_filter: A SpatialQueryFilter that determines which colliders are taken into account in the query.
  • callback: A callback function called for each intersection.
§Example
use avian3d::prelude::*;
use bevy::prelude::*;

fn print_shape_intersections(spatial_query: SpatialQuery) {
    let mut intersections = vec![];

    spatial_query.shape_intersections_callback(
        &Collider::sphere(0.5),          // Shape
        Vec3::ZERO,                      // Shape position
        Quat::default(),                 // Shape rotation
        SpatialQueryFilter::default(),   // Query filter
        |entity| {                       // Callback function
            intersections.push(entity);
            true
        },
    );

    for entity in intersections.iter() {
        println!("Entity: {:?}", entity);
    }
}

Trait Implementations§

source§

impl SystemParam for SpatialQuery<'_, '_>

§

type State = FetchState

Used to store data which persists across invocations of a system.
§

type Item<'w, 's> = SpatialQuery<'w, 's>

The item type returned when constructing this system param. The value of this associated type should be Self, instantiated with new lifetimes. Read more
source§

fn init_state(world: &mut World, system_meta: &mut SystemMeta) -> Self::State

Registers any World access used by this SystemParam and creates a new instance of this param’s State.
source§

unsafe fn new_archetype( state: &mut Self::State, archetype: &Archetype, system_meta: &mut SystemMeta )

For the specified Archetype, registers the components accessed by this SystemParam (if applicable).a Read more
source§

fn apply(state: &mut Self::State, system_meta: &SystemMeta, world: &mut World)

Applies any deferred mutations stored in this SystemParam’s state. This is used to apply Commands during apply_deferred.
source§

fn queue( state: &mut Self::State, system_meta: &SystemMeta, world: DeferredWorld<'_> )

Queues any deferred mutations to be applied at the next apply_deferred.
source§

unsafe fn get_param<'w, 's>( state: &'s mut Self::State, system_meta: &SystemMeta, world: UnsafeWorldCell<'w>, change_tick: Tick ) -> Self::Item<'w, 's>

Creates a parameter to be passed into a SystemParamFunction. Read more
source§

impl<'w, 's> ReadOnlySystemParam for SpatialQuery<'w, 's>

Auto Trait Implementations§

§

impl<'w, 's> Freeze for SpatialQuery<'w, 's>

§

impl<'w, 's> !RefUnwindSafe for SpatialQuery<'w, 's>

§

impl<'w, 's> Send for SpatialQuery<'w, 's>

§

impl<'w, 's> Sync for SpatialQuery<'w, 's>

§

impl<'w, 's> Unpin for SpatialQuery<'w, 's>

§

impl<'w, 's> !UnwindSafe for SpatialQuery<'w, 's>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T, U> AsBindGroupShaderType<U> for T
where U: ShaderType, &'a T: for<'a> Into<U>,

source§

fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U

Return the T ShaderType for self. When used in AsBindGroup derives, it is safe to assume that all images in self exist.
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Downcast<T> for T

source§

fn downcast(&self) -> &T

source§

impl<T> Downcast for T
where T: Any,

source§

fn into_any(self: Box<T>) -> Box<dyn Any>

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.
source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
source§

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.
source§

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.
source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Upcast<T> for T

source§

fn upcast(&self) -> Option<&T>

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> ConditionalSend for T
where T: Send,

source§

impl<T> Settings for T
where T: 'static + Send + Sync,

source§

impl<T> WasmNotSend for T
where T: Send,

source§

impl<T> WasmNotSendSync for T

source§

impl<T> WasmNotSync for T
where T: Sync,