Crate cml_core_wasm

Source

Modules§

wasm_wrappers

Macros§

impl_raw_bytes_api
impl_wasm_cbor_api
Implements to/from CBOR bytes API for WASM wrappers using CML’s Serialize i.e. it remembers encodings
impl_wasm_cbor_event_serialize_api
Implements to/from CBOR bytes API for WASM wrappers using cbor_event’s Serialize i.e. it does not remember encodings
impl_wasm_cbor_json_api
impl_wasm_cbor_json_api_cbor_event_serialize
We use this instead of cml_core::impl_wasm_cbor_json_api for types that do not implement cml’s Serialize. e.g. CIP25/Byron just do cbor_event’s due to not supporting preserve-encodings=true All other methods are identical to impl_wasm_cbor_json_api though.
impl_wasm_conversions
Various code-generation macros to help with WASM wrapper creation. Includes many things that auto-generated by cddl-codegen so we can use these with utility code that had to be hand-written. Auto-declare From/AsRef conversions between rust and WASM wrappers
impl_wasm_json_api
Implements the to/from JSON + JS object API for WASM wrappers
impl_wasm_list
Convenience creator for generic WASM-exposable list This is exactly as the ones created by cddl-codegen so it is useful for utility functionality where those wouldn’t have been automatically generated.
impl_wasm_list_add
This shouldn’t be explicitly called - only via impl_wasm_list!() We use this to get around restrictions in outer macros evaluating before inner macros which breaks wasm_bindgen’s parameter parsing resulting in FromWasmAbi on &T instead See comment for impl_wasm_map_insert_get! for more context
impl_wasm_map
Convenience creator for generic WASM-exposable map This is exactly as the ones created by cddl-codegen so it is useful for utility functionality where those wouldn’t have been automatically generated.
impl_wasm_map_btree
Useful for Byron/cip25/etc where we don’t use OrderedHashMap
impl_wasm_map_get
This shouldn’t be explicitly called - only via impl_wasm_* macros here
impl_wasm_map_insert
This shouldn’t be explicitly called - only via impl_wasm_* macros here
impl_wasm_map_insert_get
This shouldn’t be explicitly called - only via impl_wasm_map!() We use this to get around restrictions in outer macros evaluating before inner macros which breaks wasm_bindgen’s parameter parsing resulting in FromWasmAbi on &T instead of RefFromWasmAbi on T being used. This happened when these were inlined directly in impl_wasm_map!() e.g.:
wasm_as_ref
This shouldn’t be explicitly called - only via impl_wasm_* macros here This is here due to problems with AsRef vs & in impl_wasm_get expression, e is wasm-exposable
wasm_copied_or_cloned
This shouldn’t be explicitly called - only via impl_wasm_* macros here expression, e is Copy
wasm_val_clone
This shouldn’t be explicitly called - only via impl_wasm_* macros here expression, e is Copy
wasm_val_into
This shouldn’t be explicitly called - only via impl_wasm_* macros here expression, e is wasm-exposable
wasm_val_map_into
This shouldn’t be explicitly called - only via impl_wasm_* macros here expression, e is wasm-exposable

Structs§

Int

Traits§

RawBytesEncoding