Rust codegen generating types and trait implementations.
Based on the following LambdaBuffers definition:
module Example
import Prelude
import Plutus.V1 (PlutusData)
import qualified Plutus.V1 (Bytes, AssetClass, POSIXTime)
-- Using a phantom type has to expand the data type in Rust with PhantomData markers
prod Ref a = Plutus.V1.AssetClass
derive Eq (Ref a)
derive Json (Ref a)
derive PlutusData (Ref a)
-- Type recursions will be Boxed
record User = {
name : Plutus.V1.Bytes,
status : Status,
friends : List (Ref User)
}
derive Eq User
derive Json User
derive PlutusData User
sum Status = Active Plutus.V1.POSIXTime | Inactive Plutus.V1.POSIXTime
derive Eq Status
derive Json Status
derive PlutusData Status
we get the following implementation (formatted for better readability):
Rust codegen generating types and trait implementations.
Based on the following LambdaBuffers definition:
we get the following implementation (formatted for better readability):