Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Define ArcAdapter<T> to allow values of map/set/list to be wrapped in…
… Arc Summary: ^ Let's assume that I have a thrift spec like ``` struct LargeContent { // Many many fields in here } struct Structure { 1: map<string, LargeContent> mapping; } ``` With the default support offered by thrift we cannot mapping as `BTreeMap<String, Arc<LargeContent>>`. This is due to the fact that `rust.Arc` annotation can only be applied to fields and not to part of fields. Using `rust.Type` (and typedef) to alter the type of the map value is not functional either. Without this diff we could achieve a similar goal by defining an additional thrift struct having a single field like ``` struct LargeContentArc { rust.Arc 1: LargeContent inner; } ``` This could be functional, but it does require an extra type to be defined that could be not needed in other languages (e.g. Python). By defining the typedef as alias with an adapter we are able to alter the definition for rust code only and be a no-op type of change for other languages. Differential Revision: D62230171 fbshipit-source-id: 03b20cbc2735b3923ea1f2a7261f6bb873a64103
- Loading branch information