Skip to main content

Module optional

Module optional 

Source
Expand description

Optional<T>, an optional value that is not an object, such as a scalar or a string, stored in place.

It is one 16-byte TVMFFIAny cell holding the value or None, the ABI layout of an optional non-object value in every language. An optional object is one nullable pointer, which std::option::Option<X> already is, so Optional<X> of an object type is rejected at compile time.

A reflected field holding an optional non-object value is an Optional<T>; an Option<T> there is rejected at registration, since it is laid out as neither form.

Structs§

Optional
An optional value that is not an object, stored in place as one 16-byte cell holding the value or None. See the module docs.

Traits§

OptionalCompatible
Marker for the types whose optional the ABI stores as one 16-byte TVMFFIAny cell, the types Optional<T> accepts.