Struct gdnative_visual_script::common::ByteArray [−]
pub struct ByteArray(_);
A reference-counted vector of bytes that uses Godot's pool allocator.
Methods
impl ByteArray
impl ByteArray
pub fn new() -> ByteArray
pub fn new() -> ByteArray
Creates an empty array.
pub fn from_variant_array(array: &VariantArray) -> ByteArray
pub fn from_variant_array(array: &VariantArray) -> ByteArray
Creates an array by trying to convert each variant.
When no viable conversion exists, the default value 0
is pushed.
pub fn push(&mut self, byte: u8)
pub fn push(&mut self, byte: u8)
Appends a byte to the end of the array.
pub fn push_array(&mut self, bytes: &ByteArray)
pub fn push_array(&mut self, bytes: &ByteArray)
Appends each byte to the end of the array.
pub fn insert(&mut self, offset: i32, byte: u8) -> bool
pub fn insert(&mut self, offset: i32, byte: u8) -> bool
Inserts a byte at the given offset.
pub fn invert(&mut self)
pub fn invert(&mut self)
Inverts the order of the elements in the array.
pub fn remove(&mut self, idx: i32)
pub fn remove(&mut self, idx: i32)
Removes an element at the given offset.
pub 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.
pub fn get(&self, idx: i32) -> u8
pub fn get(&self, idx: i32) -> u8
Returns a copy of the byte at the given offset.
pub fn set(&mut self, idx: i32, byte: u8)
pub fn set(&mut self, idx: i32, byte: u8)
Sets the value of the byte at the given offset.
pub fn len(&self) -> i32
pub fn len(&self) -> i32
Returns the number of elements in the array.
pub fn new_ref(&self) -> ByteArray
pub fn new_ref(&self) -> ByteArray
Trait Implementations
impl ToVariant for ByteArray
impl ToVariant for ByteArray
fn to_variant(&self) -> Variant
fn to_variant(&self) -> Variant
fn from_variant(variant: &Variant) -> Option<ByteArray>
fn from_variant(variant: &Variant) -> Option<ByteArray>
impl<'l> From<&'l ByteArray> for Variant
impl<'l> From<&'l ByteArray> for Variant
impl Default for ByteArray
impl Default for ByteArray
impl Drop for ByteArray
impl Drop for ByteArray