pub struct ContactPoints(/* private fields */);Expand description
An opaque, fixed-capacity collection of the solved contact points carried by
a CollisionEvent (at most CAPACITY).
The backing storage is a stack-allocated inline array (no heap allocation).
The concrete container type is an implementation detail and is
deliberately not part of the public API, so it can change without a
breaking release. Interact with it through the inherent methods,
IntoIterator (by value or by reference), FromIterator, or indexing.
Implementations§
Source§impl ContactPoints
impl ContactPoints
Sourcepub fn new() -> ContactPoints
pub fn new() -> ContactPoints
Create an empty set.
Sourcepub fn push(&mut self, contact: ContactPoint)
pub fn push(&mut self, contact: ContactPoint)
Append a contact point. Silently ignored when already at
CAPACITY points.
Sourcepub fn first(&self) -> Option<&ContactPoint>
pub fn first(&self) -> Option<&ContactPoint>
The first contact point, if any.
Sourcepub fn iter(&self) -> Iter<'_, ContactPoint>
pub fn iter(&self) -> Iter<'_, ContactPoint>
Iterate over the contact points by reference.
Sourcepub fn as_slice(&self) -> &[ContactPoint]
pub fn as_slice(&self) -> &[ContactPoint]
View the contact points as a slice.
Trait Implementations§
Source§impl Clone for ContactPoints
impl Clone for ContactPoints
Source§fn clone(&self) -> ContactPoints
fn clone(&self) -> ContactPoints
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ContactPoints
impl Debug for ContactPoints
Source§impl Default for ContactPoints
impl Default for ContactPoints
Source§fn default() -> ContactPoints
fn default() -> ContactPoints
Returns the “default value” for a type. Read more
Source§impl FromIterator<ContactPoint> for ContactPoints
impl FromIterator<ContactPoint> for ContactPoints
Source§fn from_iter<I>(iter: I) -> ContactPointswhere
I: IntoIterator<Item = ContactPoint>,
fn from_iter<I>(iter: I) -> ContactPointswhere
I: IntoIterator<Item = ContactPoint>,
Creates a value from an iterator. Read more
Source§impl Index<usize> for ContactPoints
impl Index<usize> for ContactPoints
Source§type Output = ContactPoint
type Output = ContactPoint
The returned type after indexing.
Source§impl<'a> IntoIterator for &'a ContactPoints
impl<'a> IntoIterator for &'a ContactPoints
Source§type Item = &'a ContactPoint
type Item = &'a ContactPoint
The type of the elements being iterated over.
Source§type IntoIter = Iter<'a, ContactPoint>
type IntoIter = Iter<'a, ContactPoint>
Which kind of iterator are we turning this into?
Source§fn into_iter(self) -> <&'a ContactPoints as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a ContactPoints as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
Source§impl IntoIterator for ContactPoints
impl IntoIterator for ContactPoints
Source§type Item = ContactPoint
type Item = ContactPoint
The type of the elements being iterated over.
Source§type IntoIter = IntoIter<ContactPoint, 4>
type IntoIter = IntoIter<ContactPoint, 4>
Which kind of iterator are we turning this into?
Source§fn into_iter(self) -> <ContactPoints as IntoIterator>::IntoIter
fn into_iter(self) -> <ContactPoints as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
Source§impl PartialEq for ContactPoints
impl PartialEq for ContactPoints
impl StructuralPartialEq for ContactPoints
Auto Trait Implementations§
impl Freeze for ContactPoints
impl RefUnwindSafe for ContactPoints
impl Send for ContactPoints
impl Sync for ContactPoints
impl Unpin for ContactPoints
impl UnsafeUnpin for ContactPoints
impl UnwindSafe for ContactPoints
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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>
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)
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)
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
impl<T> DowncastSync for T
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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>
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 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>
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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().