Convert from a lua value to a deserializable type,
with a slightly more helpful error message in case of failure.
NOTE: the “, while processing” portion of the error messages generated
here is coupled with a regex in typing.lua!
Given a name path like foo or foo.bar.baz, sets up the module
registry hierarchy to instantiate that path.
Returns the leaf node of that path to allow the caller to
register/assign functions etc. into it
Provides implementations of __pairs, __index and __len metamethods
for a type that is Serialize and UserData.
Neither implementation is considered to be ideal, as we must
first serialize the value into a json Value which is then either
iterated over, or indexed to produce the appropriate result for
the metamethod.
This function will try to obtain a native lua representation
of the provided value. It does this by attempting to iterate
the pairs of any userdata it finds as either the value itself
or the values of a table value by recursively applying
materialize_to_lua_value to the value.
This produces a lua value that can then be processed by the
Deserialize impl on Value.
Returns the field names of T as they appear in input data, after rename
and rename_all, for a plain derive(Deserialize) struct. Returns None
for a struct with #[serde(flatten)], an enum, a newtype, or a hand-written
impl.