Struct gdnative_core::ByteArray [−][src]
pub struct ByteArray(_);
A reference-counted vector of bytes that uses Godot's pool allocator.
Methods
impl ByteArray[src]
impl ByteArraypub fn new() -> Self[src]
pub fn new() -> SelfCreates an empty array.
pub fn from_variant_array(array: &VariantArray) -> Self[src]
pub fn from_variant_array(array: &VariantArray) -> SelfCreates 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)[src]
pub fn push(&mut self, byte: u8)Appends a byte to the end of the array.
pub fn push_array(&mut self, bytes: &ByteArray)[src]
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[src]
pub fn insert(&mut self, offset: i32, byte: u8) -> boolInserts a byte at the given offset.
pub fn invert(&mut self)[src]
pub fn invert(&mut self)Inverts the order of the elements in the array.
pub fn remove(&mut self, idx: i32)[src]
pub fn remove(&mut self, idx: i32)Removes an element at the given offset.
pub fn resize(&mut self, size: i32)[src]
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[src]
pub fn get(&self, idx: i32) -> u8Returns a copy of the byte at the given offset.
pub fn set(&mut self, idx: i32, byte: u8)[src]
pub fn set(&mut self, idx: i32, byte: u8)Sets the value of the byte at the given offset.
pub fn len(&self) -> i32[src]
pub fn len(&self) -> i32Returns the number of elements in the array.
pub fn new_ref(&self) -> ByteArray[src]
pub fn new_ref(&self) -> ByteArrayTrait Implementations
impl<'l> From<&'l ByteArray> for Variant[src]
impl<'l> From<&'l ByteArray> for Variantimpl Drop for ByteArray[src]
impl Drop for ByteArrayimpl Default for ByteArray[src]
impl Default for ByteArrayimpl ToVariant for ByteArray[src]
impl ToVariant for ByteArrayfn to_variant(&self) -> Variant[src]
fn to_variant(&self) -> Variantfn from_variant(variant: &Variant) -> Option<Self>[src]
fn from_variant(variant: &Variant) -> Option<Self>