#[repr(C)]pub struct TVMFFIByteArray {
pub data: *const u8,
pub size: usize,
}
Expand description
Byte array data structure used by String and Bytes.
Fields§
§data: *const u8
§size: usize
Implementations§
Source§impl TVMFFIByteArray
impl TVMFFIByteArray
pub fn new(data: *const u8, size: usize) -> Self
Sourcepub unsafe fn from_str(data: &str) -> Self
pub unsafe fn from_str(data: &str) -> Self
Unsafe function to create a TVMFFIByteArray from a string This function is unsafe as it does not check lifetime of the string the caller must ensure that the string is valid for the lifetime of the TVMFFIByteArray
§Arguments
data
- The string to create the TVMFFIByteArray from.
§Returns
TVMFFIByteArray
- The created TVMFFIByteArray.
Auto Trait Implementations§
impl Freeze for TVMFFIByteArray
impl RefUnwindSafe for TVMFFIByteArray
impl !Send for TVMFFIByteArray
impl !Sync for TVMFFIByteArray
impl Unpin for TVMFFIByteArray
impl UnwindSafe for TVMFFIByteArray
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more