Add rust_provider_backend_api
commit9bbaca06da418fdabc18e17917495abc49854d9e
authorJake Bailey <jakebailey@fb.com>
Sat, 24 Sep 2022 00:01:01 +0000 (23 17:01 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Sat, 24 Sep 2022 00:01:01 +0000 (23 17:01 -0700)
tree806de8dd6726fdf4f0a81dafbbb89b11e1700cfc
parent598d05c4e3c6686fd1baa6e53efa605bcac8c7d2
Add rust_provider_backend_api

Summary: Add a trait abstracting over the set of providers necessary to typecheck a file, and make use of it in rust_provider_backend_ffi. When using a backend other than HhServerProviderBackend, raise panics (which are converted to OCaml exceptions by `ocaml_ffi!`) when attempting to invoke one of the rust_provider_backend_ffi functions outside of the minimum set necessary to typecheck a file. This makes it easier to implement the RustProviderBackend trait for use cases which are only interested in typechecking files (e.g., hh_distc workers, potentially hh rearchitecture workers, potentially zoncolan workers).

Reviewed By: edwinsmith

Differential Revision: D39780735

fbshipit-source-id: 6d0152e831679f9d4fd5c98925cf5f59c44fd812
hphp/hack/src/providers/Cargo.toml [new file with mode: 0644]
hphp/hack/src/providers/cargo/rust_provider_backend_ffi/Cargo.toml
hphp/hack/src/providers/hackrs_provider_backend/Cargo.toml
hphp/hack/src/providers/hackrs_provider_backend/hackrs_provider_backend.rs
hphp/hack/src/providers/rust_provider_backend_api.rs [new file with mode: 0644]
hphp/hack/src/providers/rust_provider_backend_ffi.rs