[][src]Struct rustler::OwnedBinary

pub struct OwnedBinary { /* fields omitted */ }

Methods

impl<'a> OwnedBinary[src]

pub unsafe fn from_raw(inner: ErlNifBinary) -> OwnedBinary[src]

pub fn new(size: usize) -> Option<OwnedBinary>[src]

Allocates a new OwnedBinary with size size.

Note that the memory is not initially guaranteed to be any particular value. If an empty buffer is needed, you should manually zero it.

pub fn from_unowned(from_bin: &Binary) -> Option<OwnedBinary>[src]

Copies a given Binary.

#[must_use]
pub fn realloc(&mut self, size: usize) -> bool
[src]

Attempts to reallocate the buffer with the new size. Returns false if the buffer cannot be reallocated.

pub fn realloc_or_copy(&mut self, size: usize)[src]

Attempts to reallocate the buffer with the new size. If reallocation fails, it will perform a copy instead. Memory outside the range of the original buffer will not be initialized. If this needs to be empty, clear it manually.

pub fn as_slice(&self) -> &'a [u8][src]

pub fn as_mut_slice(&mut self) -> &'a mut [u8][src]

pub fn release<'b>(self, env: Env<'b>) -> Binary<'b>[src]

Releases control of the binary to the VM. After this point the binary will be immutable.

Trait Implementations

impl Drop for OwnedBinary[src]

impl Send for OwnedBinary[src]

impl DerefMut for OwnedBinary[src]

impl Deref for OwnedBinary[src]

type Target = [u8]

The resulting type after dereferencing.

impl Borrow<[u8]> for OwnedBinary[src]

impl BorrowMut<[u8]> for OwnedBinary[src]

Auto Trait Implementations

impl !Sync for OwnedBinary

Blanket Implementations

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

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

impl<T> Any for T where
    T: 'static + ?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

The type returned in the event of a conversion error.