[−][src]Struct rustler::OwnedBinary
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]
#[must_use]
pub fn realloc(&mut self, size: usize) -> boolAttempts 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]
impl Borrow<[u8]> for OwnedBinary
[src]
impl BorrowMut<[u8]> for OwnedBinary
[src]
fn borrow_mut(&mut self) -> &mut [u8]
[src]
Auto Trait Implementations
impl !Sync for OwnedBinary
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,