[−][src]Struct bevy_transform::components::Children
Implementations
impl Children
[src]
Methods from Deref<Target = SmallVec<[Entity; 8]>>
pub unsafe fn set_len(&mut self, new_len: usize)
[src]
Sets the length of a vector.
This will explicitly set the size of the vector, without actually modifying its buffers, so it is up to the caller to ensure that the vector is actually the specified size.
pub fn inline_size(&self) -> usize
[src]
The maximum number of elements this vector can hold inline
pub fn len(&self) -> usize
[src]
The number of elements stored in the vector
pub fn is_empty(&self) -> bool
[src]
Returns true
if the vector is empty
pub fn capacity(&self) -> usize
[src]
The number of items the vector can hold without reallocating
pub fn spilled(&self) -> bool
[src]
Returns true
if the data has spilled into a separate heap-allocated buffer.
pub fn drain<R>(&mut self, range: R) -> Drain<'_, A> where
R: RangeBounds<usize>,
[src]
R: RangeBounds<usize>,
Creates a draining iterator that removes the specified range in the vector and yields the removed items.
Note 1: The element range is removed even if the iterator is only partially consumed or not consumed at all.
Note 2: It is unspecified how many elements are removed from the vector
if the Drain
value is leaked.
Panics
Panics if the starting point is greater than the end point or if the end point is greater than the length of the vector.
pub fn push(&mut self, value: <A as Array>::Item)
[src]
Append an item to the vector.
pub fn pop(&mut self) -> Option<<A as Array>::Item>
[src]
Remove an item from the end of the vector and return it, or None if empty.
pub fn grow(&mut self, new_cap: usize)
[src]
Re-allocate to set the capacity to max(new_cap, inline_size())
.
Panics if new_cap
is less than the vector's length
or if the capacity computation overflows usize
.
pub fn try_grow(&mut self, new_cap: usize) -> Result<(), CollectionAllocErr>
[src]
Re-allocate to set the capacity to max(new_cap, inline_size())
.
Panics if new_cap
is less than the vector's length
pub fn reserve(&mut self, additional: usize)
[src]
Reserve capacity for additional
more elements to be inserted.
May reserve more space to avoid frequent reallocations.
Panics if the capacity computation overflows usize
.
pub fn try_reserve(
&mut self,
additional: usize
) -> Result<(), CollectionAllocErr>
[src]
&mut self,
additional: usize
) -> Result<(), CollectionAllocErr>
Reserve capacity for additional
more elements to be inserted.
May reserve more space to avoid frequent reallocations.
pub fn reserve_exact(&mut self, additional: usize)
[src]
Reserve the minimum capacity for additional
more elements to be inserted.
Panics if the new capacity overflows usize
.
pub fn try_reserve_exact(
&mut self,
additional: usize
) -> Result<(), CollectionAllocErr>
[src]
&mut self,
additional: usize
) -> Result<(), CollectionAllocErr>
Reserve the minimum capacity for additional
more elements to be inserted.
pub fn shrink_to_fit(&mut self)
[src]
Shrink the capacity of the vector as much as possible.
When possible, this will move data from an external heap buffer to the vector's inline storage.
pub fn truncate(&mut self, len: usize)
[src]
Shorten the vector, keeping the first len
elements and dropping the rest.
If len
is greater than or equal to the vector's current length, this has no
effect.
This does not re-allocate. If you want the vector's capacity to shrink, call
shrink_to_fit
after truncating.
pub fn as_slice(&self) -> &[<A as Array>::Item]
[src]
Extracts a slice containing the entire vector.
Equivalent to &s[..]
.
pub fn as_mut_slice(&mut self) -> &mut [<A as Array>::Item]
[src]
Extracts a mutable slice of the entire vector.
Equivalent to &mut s[..]
.
pub fn swap_remove(&mut self, index: usize) -> <A as Array>::Item
[src]
Remove the element at position index
, replacing it with the last element.
This does not preserve ordering, but is O(1).
Panics if index
is out of bounds.
pub fn clear(&mut self)
[src]
Remove all elements from the vector.
pub fn remove(&mut self, index: usize) -> <A as Array>::Item
[src]
Remove and return the element at position index
, shifting all elements after it to the
left.
Panics if index
is out of bounds.
pub fn insert(&mut self, index: usize, element: <A as Array>::Item)
[src]
Insert an element at position index
, shifting all elements after it to the right.
Panics if index
is out of bounds.
pub fn insert_many<I>(&mut self, index: usize, iterable: I) where
I: IntoIterator<Item = <A as Array>::Item>,
[src]
I: IntoIterator<Item = <A as Array>::Item>,
Insert multiple elements at position index
, shifting all following elements toward the
back.
pub fn retain<F>(&mut self, f: F) where
F: FnMut(&mut <A as Array>::Item) -> bool,
[src]
F: FnMut(&mut <A as Array>::Item) -> bool,
Retains only the elements specified by the predicate.
In other words, remove all elements e
such that f(&e)
returns false
.
This method operates in place and preserves the order of the retained
elements.
pub fn dedup(&mut self) where
<A as Array>::Item: PartialEq<<A as Array>::Item>,
[src]
<A as Array>::Item: PartialEq<<A as Array>::Item>,
Removes consecutive duplicate elements.
pub fn dedup_by<F>(&mut self, same_bucket: F) where
F: FnMut(&mut <A as Array>::Item, &mut <A as Array>::Item) -> bool,
[src]
F: FnMut(&mut <A as Array>::Item, &mut <A as Array>::Item) -> bool,
Removes consecutive duplicate elements using the given equality relation.
pub fn dedup_by_key<F, K>(&mut self, key: F) where
F: FnMut(&mut <A as Array>::Item) -> K,
K: PartialEq<K>,
[src]
F: FnMut(&mut <A as Array>::Item) -> K,
K: PartialEq<K>,
Removes consecutive elements that map to the same key.
pub fn resize_with<F>(&mut self, new_len: usize, f: F) where
F: FnMut() -> <A as Array>::Item,
[src]
F: FnMut() -> <A as Array>::Item,
Resizes the SmallVec
in-place so that len
is equal to new_len
.
If new_len
is greater than len
, the SmallVec
is extended by the difference, with each
additional slot filled with the result of calling the closure f
. The return values from f
If new_len
is less than len
, the SmallVec
is simply truncated.
This method uses a closure to create new values on every push. If you'd rather Clone
a given
value, use resize
. If you want to use the Default
trait to generate values, you can pass
Default::default()
as the second argument.
Added for std::vec::Vec compatibility (added in Rust 1.33.0)
let mut vec : SmallVec<[_; 4]> = smallvec![1, 2, 3]; vec.resize_with(5, Default::default); assert_eq!(&*vec, &[1, 2, 3, 0, 0]); let mut vec : SmallVec<[_; 4]> = smallvec![]; let mut p = 1; vec.resize_with(4, || { p *= 2; p }); assert_eq!(&*vec, &[2, 4, 8, 16]);
pub fn as_ptr(&self) -> *const <A as Array>::Item
[src]
Returns a raw pointer to the vector's buffer.
pub fn as_mut_ptr(&mut self) -> *mut <A as Array>::Item
[src]
Returns a raw mutable pointer to the vector's buffer.
pub fn insert_from_slice(&mut self, index: usize, slice: &[<A as Array>::Item])
[src]
Copy elements from a slice into the vector at position index
, shifting any following
elements toward the back.
For slices of Copy
types, this is more efficient than insert
.
pub fn extend_from_slice(&mut self, slice: &[<A as Array>::Item])
[src]
Copy elements from a slice and append them to the vector.
For slices of Copy
types, this is more efficient than extend
.
pub fn resize(&mut self, len: usize, value: <A as Array>::Item)
[src]
Resizes the vector so that its length is equal to len
.
If len
is less than the current length, the vector simply truncated.
If len
is greater than the current length, value
is appended to the
vector until its length equals len
.
Trait Implementations
impl Clone for Children
[src]
impl Debug for Children
[src]
impl Default for Children
[src]
impl Deref for Children
[src]
type Target = SmallVec<[Entity; 8]>
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
impl DerefMut for Children
[src]
impl DeserializeProperty for Children
[src]
fn deserialize(
deserializer: &mut dyn Deserializer<'_>,
property_type_registry: &PropertyTypeRegistry
) -> Result<Box<dyn Property>, Error>
[src]
deserializer: &mut dyn Deserializer<'_>,
property_type_registry: &PropertyTypeRegistry
) -> Result<Box<dyn Property>, Error>
impl MapEntities for Children
[src]
fn map_entities(
&mut self,
entity_map: &EntityMap
) -> Result<(), MapEntitiesError>
[src]
&mut self,
entity_map: &EntityMap
) -> Result<(), MapEntitiesError>
impl Properties for Children
[src]
fn prop(&self, name: &str) -> Option<&dyn Property>
[src]
fn prop_mut(&mut self, name: &str) -> Option<&mut dyn Property>
[src]
fn prop_with_index(&self, index: usize) -> Option<&dyn Property>
[src]
fn prop_with_index_mut(&mut self, index: usize) -> Option<&mut dyn Property>
[src]
fn prop_name(&self, index: usize) -> Option<&str>
[src]
fn prop_len(&self) -> usize
[src]
fn iter_props(&self) -> PropertyIter<'_>
[src]
fn set_prop(&mut self, name: &str, value: &(dyn Property + 'static))
[src]
fn to_dynamic(&self) -> DynamicProperties
[src]
impl Property for Children
[src]
fn type_name(&self) -> &str
[src]
fn any(&self) -> &dyn Any
[src]
fn any_mut(&mut self) -> &mut dyn Any
[src]
fn clone_prop(&self) -> Box<dyn Property>
[src]
fn set(&mut self, value: &dyn Property)
[src]
fn apply(&mut self, value: &dyn Property)
[src]
fn as_properties(&self) -> Option<&dyn Properties>
[src]
fn serializable<'a>(
&'a self,
registry: &'a PropertyTypeRegistry
) -> Serializable<'a>
[src]
&'a self,
registry: &'a PropertyTypeRegistry
) -> Serializable<'a>
fn property_type(&self) -> PropertyType
[src]
Auto Trait Implementations
impl RefUnwindSafe for Children
impl Send for Children
impl Sync for Children
impl Unpin for Children
impl UnwindSafe for Children
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Component for T where
T: 'static + Send + Sync,
T: 'static + Send + Sync,
impl<T> Downcast for T where
T: Any,
T: Any,
pub fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn as_any(&self) -> &(dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> DowncastSync for T where
T: Send + Sync + Any,
T: Send + Sync + Any,
impl<T> From<T> for T
[src]
impl<T> FromResources for T where
T: Default,
[src]
T: Default,
pub fn from_resources(_resources: &Resources) -> T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<P> PropertiesVal for P where
P: Properties,
[src]
P: Properties,
pub fn prop_val<T>(&self, name: &str) -> Option<&T> where
T: 'static,
[src]
T: 'static,
pub fn set_prop_val<T>(&mut self, name: &str, value: T) where
T: 'static,
[src]
T: 'static,
impl<T> Resource for T where
T: 'static + Send + Sync,
[src]
T: 'static + Send + Sync,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,