{"id":22573243,"url":"https://github.com/taaitaaiger/jlrsreflect.jl","last_synced_at":"2025-04-10T14:55:05.494Z","repository":{"id":61798401,"uuid":"276719229","full_name":"Taaitaaiger/JlrsReflect.jl","owner":"Taaitaaiger","description":"Generate Rust wrappers for Julia types that can be used with jlrs","archived":false,"fork":false,"pushed_at":"2022-12-02T00:43:37.000Z","size":202,"stargazers_count":21,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-24T13:11:14.043Z","etag":null,"topics":["julia","rust"],"latest_commit_sha":null,"homepage":"","language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Taaitaaiger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-02T18:30:51.000Z","updated_at":"2023-05-23T01:04:03.000Z","dependencies_parsed_at":"2022-10-21T11:15:13.418Z","dependency_job_id":null,"html_url":"https://github.com/Taaitaaiger/JlrsReflect.jl","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Taaitaaiger%2FJlrsReflect.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Taaitaaiger%2FJlrsReflect.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Taaitaaiger%2FJlrsReflect.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Taaitaaiger%2FJlrsReflect.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Taaitaaiger","download_url":"https://codeload.github.com/Taaitaaiger/JlrsReflect.jl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248238717,"owners_count":21070560,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["julia","rust"],"created_at":"2024-12-08T02:14:29.150Z","updated_at":"2025-04-10T14:55:05.453Z","avatar_url":"https://github.com/Taaitaaiger.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JlrsReflect\n\n[![Coverage](https://codecov.io/gh/Taaitaaiger/JlrsReflect.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/Taaitaaiger/JlrsReflect.jl)\n\nThis package can be used to generate jlrs-compatible Rust implementations of Julia structs (wrappers).\n\nWrappers can be generated for many structs, including structs with union fields, tuple fields, and type parameters. Wrappers are recursively generated for all of a type's fields, and are always generated for the most general case; any provided type parameter is erased and included in the set of structs for which wrappers are generated.\n\nThree things that are not supported are structs with union or tuple fields that depend on a type parameter (eg `struct SomeGenericStruct{T} a::Tuple{Int32, T} end`, `SomeGenericStruct{T} a::Union{Int32, T} end`), unions used as generic parameters (eg `SomeGenericStruct{Union{A,B}}`), and structs with atomic fields. An error is thrown in the first two cases, in the final case no wrapper is generated for the struct itself but wrappers for all of its dependencies will be generated.\n\nYou can use this package by calling the `reflect` function with a `Vector` of types:\n\n```julia\nstruct TypeA\n    # ...fields\nend\n\nstruct TypeB{T}\n    # ...fields\nend\n\n...\n\nwrappers = JlrsReflect.reflect([TypeA, TypeB, ...]);\n\n# Print wrappers to standard output\nprintln(wrappers)\n\n# Write wrappers to file\nopen(\"julia_wrappers.rs\", \"w\") do f\n    write(f, wrappers)\nend\n```\n\nWrappers for types used as fields and type parameters are automatically generated. If you want or need to rename structs or their fields you can use `renamestruct!` and `renamefields!` as follows:\n\n```julia\nwrappers = JlrsReflect.reflect([TypeA, TypeB, ...])\nrenamestruct!(wrappers, TypeA, \"StructA\")\nrenamefields!(wrappers, TypeB, [:fielda =\u003e \"field_a\", :fieldb =\u003e \"field_b\"])\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaaitaaiger%2Fjlrsreflect.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaaitaaiger%2Fjlrsreflect.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaaitaaiger%2Fjlrsreflect.jl/lists"}