Class in ffi::types compiler

ConstBytes

class ConstBytes
Import
use ffi::types::{ConstBytes};
Source: compiler/src/builtin_docs/ffi/types.hy

FFI tag for a read-only byte view (const uint8_t *) of a string or Vec<byte>.

A string is lent in place without a copy, and so is a packed Vec<byte> under the same rules as Bytes; any other Vec<byte> is copied in once and never copied back. No NUL terminator is added, so pass the length separately. Argument only.

See also#

  • string
  • Vec
  • ffi::types::Bytes
  • Int: FFI tag for a 64-bit signed integer (int64_t), passed from and returned as int.
  • Float: FFI tag for a 64-bit float (double), passed from and returned as float.
  • String: FFI tag for a NUL-terminated C string (const char *), passed from and returned as string.
  • Void: FFI tag for no value (void), valid only as a return type.
  • Bool: FFI tag for a C bool (one byte, 0 or 1), passed from and returned as bool.
↑ ↓ navigate ↵ open