Struct physx::owner::Owner

source ·
#[repr(transparent)]
pub struct Owner<T> { /* private fields */ }
Expand description

An owning wrapper around a pointer. PhysX object creation returns pointers which in normal Rust would be a Box, but Box cannot be used here because it has specific allocation requirements that the C++ code does not fulfill.

Implementations§

source§

impl<T> Owner<T>

source

pub fn into_ptr<S>(self) -> *mut Swhere T: Class<S>,

Consumes the Owner without calling Drop and returns the raw pointer it was wrapping.

Trait Implementations§

source§

impl<T> AsMut<T> for Owner<T>

source§

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

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T> AsRef<T> for Owner<T>

source§

fn as_ref(&self) -> &T

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T, S> Class<S> for Owner<T>where T: Class<S>,

source§

fn as_ptr(&self) -> *const S

Returns a raw const pointer to the wrapped type. Retrieving a raw pointer is safe. However, pretty much any use of a raw pointer is unsafe. In particular: this pointer should not be used to construct a second owning wrapper around the pointer.
source§

fn as_mut_ptr(&mut self) -> *mut S

Returns a raw mut pointer to the wrapped type. Retrieving a raw pointer is safe. However, pretty much any use of a raw pointer is unsafe. In particular: this pointer should not be used to construct a second owning wrapper around the pointer.
source§

impl<T> Deref for Owner<T>

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<T> DerefMut for Owner<T>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl<T> Drop for Owner<T>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<T: Send> Send for Owner<T>

source§

impl<T: Sync> Sync for Owner<T>

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for Owner<T>where T: RefUnwindSafe,

§

impl<T> Unpin for Owner<T>

§

impl<T> UnwindSafe for Owner<T>where T: RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Actor for Twhere T: Class<PxActor> + Base,

source§

fn get_type(&self) -> ActorType

Get the concrete type of the actor
source§

fn get_world_bounds(&self, inflation: f32) -> PxBounds3

Get the world bounds of this actor
source§

fn set_actor_flag(&mut self, flag: ActorFlag, value: bool)

Set a flag on this actor
source§

fn set_actor_flags(&mut self, flags: ActorFlags)

Set the flags to the provided value
source§

fn get_actor_flags(&self) -> ActorFlags

Get all actor flags
source§

fn set_dominance_group(&mut self, group: u8)

Set the dominance group
source§

fn get_dominance_group(&self) -> u8

Read the dominance group
source§

fn set_owner_client(&mut self, client: u8)

Set the owner client of this actor
source§

fn get_owner_client(&self) -> u8

Read the owner client of this actor
source§

fn enable_visualization(&mut self, enable: bool)

Enable visualization of this actor
source§

fn enable_gravity(&mut self, enable: bool)

set gravity state
source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Base for Twhere T: Class<PxBase>,

source§

fn get_concrete_type_name(&self) -> Option<&str>

Get the name of the real type referenced by this pointer, or None if the returned string is not valid
source§

fn get_concrete_type(&self) -> ConcreteType

Returns an enumerated value identifying the type. Read more
source§

fn set_base_flag(&mut self, flag: BaseFlag, value: bool)

Set or unset the specified flag on this object.
source§

fn set_base_flags(&mut self, in_flags: BaseFlags)

Set the BaseFlags of this object. Note that replaces all flags currently on the object. Use set_base_flag to set individual flags.
source§

fn get_base_flags(&self) -> BaseFlags

Read the BaseFlags of this object
source§

fn is_releasable(&self) -> bool

Returns true if this object can be released, i.e., it is not subordinate.
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> BoxGeometry for Twhere T: Class<PxBoxGeometry> + Geometry,

source§

fn new(half_x: f32, half_y: f32, half_z: f32) -> PxBoxGeometry

source§

fn default() -> PxBoxGeometry

source§

fn is_valid(&self) -> bool

source§

impl<T> CapsuleGeometry for Twhere T: Class<PxCapsuleGeometry> + Geometry,

source§

impl<T> ConvexMeshGeometry for Twhere T: Class<PxConvexMeshGeometry> + Geometry,

source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Geometry for Twhere T: Class<PxGeometry>,

source§

impl<T> HeightFieldGeometry for Twhere T: Class<PxHeightFieldGeometry> + Geometry,

source§

fn new( height_field: &mut HeightField, flags: MeshGeometryFlags, height_scale: f32, row_scale: f32, column_scale: f32 ) -> PxHeightFieldGeometry

source§

fn default() -> PxHeightFieldGeometry

source§

fn is_valid(&self) -> bool

source§

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

const: unstable · 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> PlaneGeometry for Twhere T: Class<PxPlaneGeometry> + Geometry,

source§

impl<T> RefCounted for Twhere T: Class<PxRefCounted>,

source§

fn release(&mut self)

Decrements the reference count of the object and releases it if the new reference count is zero.
source§

fn get_reference_count(&self) -> u32

Returns the reference count of the object. Read more
source§

fn acquire_reference(&mut self)

Acquires a counted reference to this object. Read more
source§

impl<T> SphereGeometry for Twhere T: Class<PxSphereGeometry> + Geometry,

source§

impl<T> TriangleMeshGeometry for Twhere T: Class<PxTriangleMeshGeometry> + Geometry,

source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.