Skip to content

Types

Generated from crates/niso-base/include/types.h when the site was built at 7aa23e2.

This is the types section of niso_runtime.h, owned by niso-base and kept in crates/niso-base/include/types.h. The build composes it with the other sections in the order crates/niso-compose/sections.txt gives.

typedef struct niso_dom niso_dom;
typedef uint64_t niso_handle;
typedef struct niso_str {
const char* ptr;
size_t len;
} niso_str;
typedef struct niso_bytes {
const uint8_t* ptr;
size_t len;
} niso_bytes;
typedef struct niso_handles {
const niso_handle* ptr;
size_t len;
} niso_handles;
typedef struct niso_strs {
const niso_str* ptr;
size_t len;
} niso_strs;

One item of a (Node or DOMString) list: a node when node is non-zero, else str.

typedef struct niso_node_or_string {
niso_handle node;
niso_str str;
} niso_node_or_string;

A (BufferSource or USVString) value: UTF-8 text when is_string, else bytes.

typedef struct niso_buffer_or_string {
const uint8_t* ptr;
size_t len;
bool is_string;
} niso_buffer_or_string;
typedef void (*niso_drop_fn)(void* userdata);

A value the binding owns and the DOM holds by reference ([NisoHeld] any): data is opaque to the DOM, which calls drop once when it lets go. A null data is no value. Results hand back data, borrowed.

typedef struct niso_held {
void* data;
niso_drop_fn drop;
} niso_held;