Struct Float32Array

Source
pub struct Float32Array(/* private fields */);
Expand description

A reference-counted vector of f32 that uses Godot’s pool allocator.

Implementations§

Source§

impl Float32Array

Source

pub fn new() -> Float32Array

Creates an empty Float32Array.

Source

pub fn from_variant_array(array: &VariantArray) -> Float32Array

Creates an array by trying to convert each variant.

See Variant::to_float32_array.

Source

pub fn push(&mut self, val: f32)

Appends an element at the end of the array.

Source

pub fn push_array(&mut self, array: &Float32Array)

Appends a Float32Array at the end of this array.

Source

pub fn insert(&mut self, offset: i32, val: f32) -> bool

Insert a new f32 at a given position in the array.

Source

pub fn invert(&mut self)

Inverts the order of the elements in the array.

Source

pub fn remove(&mut self, idx: i32)

Removes an element at the given offset.

Source

pub fn resize(&mut self, size: i32)

Changes the size of the array, possibly removing elements or pushing default values.

Source

pub fn get(&self, idx: i32) -> f32

Returns a copy of the element at the given offset.

Source

pub fn set(&mut self, idx: i32, val: f32)

Sets the value of the element at the given offset.

Source

pub fn len(&self) -> i32

Returns the number of elements in the array.

Source

pub fn new_ref(&self) -> Float32Array

Trait Implementations§

Source§

impl Default for Float32Array

Source§

fn default() -> Float32Array

Returns the “default value” for a type. Read more
Source§

impl Drop for Float32Array

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<'l> From<&'l Float32Array> for Variant

Source§

fn from(val: &'l Float32Array) -> Variant

Converts to this type from the input type.
Source§

impl ToVariant for Float32Array

Auto Trait Implementations§

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> 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.