Bytes
class Bytes Import
Source: use ffi::types::{Bytes}; compiler/src/builtin_docs/ffi/types.hy FFI tag for a writable byte buffer (uint8_t *) made from a Vec<byte>.
Whatever C writes there ends up in the Vec: a packed Vec<byte> is lent
in place, and otherwise (a coil callback exists, the same Vec is passed
twice, or its elements are stored as words) C gets a copy that is copied
back after the call. No NUL terminator is added, so pass the length
separately. Argument only: as a return type it is
ErrorKind::Unsupported (return a Ptr instead).
See also#
Vecffi::types::PtrInt: FFI tag for a 64-bit signed integer (int64_t), passed from and returned asint.Float: FFI tag for a 64-bit float (double), passed from and returned asfloat.String: FFI tag for a NUL-terminated C string (const char *), passed from and returned asstring.Void: FFI tag for no value (void), valid only as a return type.Bool: FFI tag for a Cbool(one byte,0or1), passed from and returned asbool.Int8: FFI tag for an 8-bit signed integer (int8_t), passed from and returned asint.