pub struct StringArray(/* private fields */);
Expand description
A vector of GodotString
that uses Godot’s pool allocator.
Implementations§
Source§impl StringArray
impl StringArray
Sourcepub fn new() -> StringArray
pub fn new() -> StringArray
Creates an empty StringArray
.
Sourcepub fn from_variant_array(array: &VariantArray) -> StringArray
pub fn from_variant_array(array: &VariantArray) -> StringArray
Creates an array by trying to convert each variant.
See Variant::to_string_array
.
Sourcepub fn push(&mut self, s: &GodotString)
pub fn push(&mut self, s: &GodotString)
Appends an element at the end of the array.
Sourcepub fn push_string_array(&mut self, strings: &StringArray)
pub fn push_string_array(&mut self, strings: &StringArray)
Appends a StringArray
at the end of this array.
Sourcepub fn insert(&mut self, offset: i32, string: &GodotString) -> bool
pub fn insert(&mut self, offset: i32, string: &GodotString) -> bool
Insert a new GodotString
at a given position in the array.
Sourcepub fn resize(&mut self, size: i32)
pub fn resize(&mut self, size: i32)
Changes the size of the array, possibly removing elements or pushing default values.
Sourcepub fn get(&self, idx: i32) -> GodotString
pub fn get(&self, idx: i32) -> GodotString
Returns a copy of the element at the given offset.
Sourcepub fn set(&mut self, idx: i32, string: &GodotString)
pub fn set(&mut self, idx: i32, string: &GodotString)
Sets the value of the element at the given offset.
pub fn new_ref(&self) -> StringArray
Trait Implementations§
Source§impl Default for StringArray
impl Default for StringArray
Source§fn default() -> StringArray
fn default() -> StringArray
Returns the “default value” for a type. Read more
Source§impl Drop for StringArray
impl Drop for StringArray
Source§impl ToVariant for StringArray
impl ToVariant for StringArray
fn to_variant(&self) -> Variant
fn from_variant(variant: &Variant) -> Option<StringArray>
Auto Trait Implementations§
impl Freeze for StringArray
impl RefUnwindSafe for StringArray
impl Send for StringArray
impl Sync for StringArray
impl Unpin for StringArray
impl UnwindSafe for StringArray
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