[−][src]Struct gdnative_common::VariantArray
A reference-counted Variant
vector. Godot's generic array data type.
Negative indices can be used to count from the right.
Methods
impl VariantArray
[src]
impl VariantArray
pub fn new() -> VariantArray | [src] |
Creates an empty VariantArray
.
pub fn set(&mut self, idx: i32, val: &Variant) | [src] |
Sets the value of the element at the given offset.
pub fn get_val(&mut self, idx: i32) -> Variant | [src] |
Returns a copy of the element at the given offset.
pub fn get_ref(&self, idx: i32) -> &Variant | [src] |
Returns a reference to the element at the given offset.
pub fn get_mut_ref(&mut self, idx: i32) -> &mut Variant | [src] |
Returns a mutable reference to the element at the given offset.
pub fn count(&mut self, val: &Variant) -> i32 | [src] |
pub fn clear(&mut self) | [src] |
Clears the array, resizing to 0.
pub fn remove(&mut self, idx: i32) | [src] |
pub fn erase(&mut self, val: &Variant) | [src] |
pub fn is_empty(&self) -> bool | [src] |
Returns true
if the VariantArray
contains no elements.
pub fn len(&self) -> i32 | [src] |
Returns the number of elements in the array.
pub fn push(&mut self, val: &Variant) | [src] |
Appends an element at the end of the array.
pub fn pop(&mut self) -> Variant | [src] |
Removes an element at the end of the array.
pub fn push_front(&mut self, val: &Variant) | [src] |
Appends an element to the front of the array.
pub fn pop_front(&mut self) -> Variant | [src] |
Removes an element at the front of the array.
pub fn insert(&mut self, at: i32, val: &Variant) | [src] |
Insert a new int at a given position in the array.
pub fn find(&self, what: &Variant, from: i32) -> i32 | [src] |
Searches the array for a value and returns its index.
Pass an initial search index as the second argument.
Returns -1
if value is not found.
pub fn contains(&self, what: &Variant) -> bool | [src] |
Returns true if the VariantArray
contains the specified value.
pub fn resize(&mut self, size: i32) | [src] |
pub fn rfind(&self, what: &Variant, from: i32) -> i32 | [src] |
Searches the array in reverse order. Pass an initial search index as the second argument. If negative, the start index is considered relative to the end of the array.
pub fn find_last(&self, what: &Variant) -> i32 | [src] |
Searches the array in reverse order for a value.
Returns its index or -1
if not found.
pub fn invert(&mut self) | [src] |
Inverts the order of the elements in the array.
pub fn hash(&self) -> i32 | [src] |
Return a hashed i32 value representing the array contents.
pub fn sort(&mut self) | [src] |
pub fn new_ref(&self) -> VariantArray | [src] |
Trait Implementations
impl<'l> From<&'l VariantArray> for Variant
[src]
impl<'l> From<&'l VariantArray> for Variant
fn from(val: &'l VariantArray) -> Variant | [src] |
impl Drop for VariantArray
[src]
impl Drop for VariantArray
impl Default for VariantArray
[src]
impl Default for VariantArray
fn default() -> VariantArray | [src] |
impl ToVariant for VariantArray
[src]
impl ToVariant for VariantArray
fn to_variant(&self) -> Variant | [src] |
fn from_variant(variant: &Variant) -> Option<VariantArray> | [src] |
Auto Trait Implementations
impl Send for VariantArray
impl Send for VariantArray
impl Sync for VariantArray
impl Sync for VariantArray
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> | [src] |
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T | [src] |
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId | [src] |