[][src]Struct gdnative_common::ByteArray

pub struct ByteArray(_);

A reference-counted vector of bytes that uses Godot's pool allocator.

Methods

impl ByteArray
[src]

pub fn new() -> ByteArray
[src]

Creates an empty array.

pub fn from_variant_array(array: &VariantArray) -> ByteArray
[src]

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)
[src]

Appends a byte to the end of the array.

pub fn push_array(&mut self, bytes: &ByteArray)
[src]

Appends each byte to the end of the array.

pub fn insert(&mut self, offset: i32, byte: u8) -> bool
[src]

Inserts a byte at the given offset.

pub fn invert(&mut self)
[src]

Inverts the order of the elements in the array.

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

Removes an element at the given offset.

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

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

pub fn get(&self, idx: i32) -> u8
[src]

Returns a copy of the byte at the given offset.

pub fn set(&mut self, idx: i32, byte: u8)
[src]

Sets the value of the byte at the given offset.

pub fn len(&self) -> i32
[src]

Returns the number of elements in the array.

pub fn new_ref(&self) -> ByteArray
[src]

Trait Implementations

impl<'l> From<&'l ByteArray> for Variant
[src]

impl Drop for ByteArray
[src]

impl Default for ByteArray
[src]

impl ToVariant for ByteArray
[src]

Auto Trait Implementations

impl Send for ByteArray

impl Sync for ByteArray

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]