config

Function impl_pairs_and_index

Source
pub fn impl_pairs_and_index<T, M>(methods: &mut M)
where T: UserData + Serialize, M: UserDataMethods<T>,
Expand description

Provides implementations of __pairs and __index 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.