This repository has been archived on 2025-08-04. You can view files and clone it, but cannot push or open issues or pull requests.
rhaj/rhai_engine/rhaibook/ref/getters-setters.md
2025-04-03 09:18:05 +02:00

581 B

Properties

Data types typically expose properties, which can be accessed in a Rust-like syntax:

object . property

object . property = value ;

A runtime error is raised if the property does not exist for the object's data type.

Elvis Operator

The Elvis operator can be used to short-circuit processing if the object itself is ().

// returns () if object is ()
object ?. property

// no action if object is ()
object ?. property = value ;