derive_cache.rs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. pub enum TypeCategory {
  2. Array,
  3. Map,
  4. Str,
  5. Protobuf,
  6. Bytes,
  7. Enum,
  8. Opt,
  9. Primitive,
  10. }
  11. // auto generate, do not edit
  12. pub fn category_from_str(type_str: &str) -> TypeCategory {
  13. match type_str {
  14. "Vec" => TypeCategory::Array,
  15. "HashMap" => TypeCategory::Map,
  16. "u8" => TypeCategory::Bytes,
  17. "String" => TypeCategory::Str,
  18. "ObservableSubject"
  19. | "KeyValue"
  20. | "QueryAppRequest"
  21. | "QueryAppParams"
  22. | "CreateAppRequest"
  23. | "ColorStyle"
  24. | "CreateAppParams"
  25. | "App"
  26. | "RepeatedApp"
  27. | "UpdateAppRequest"
  28. | "UpdateAppParams"
  29. | "DeleteAppRequest"
  30. | "DeleteAppParams"
  31. | "UpdateWorkspaceRequest"
  32. | "UpdateWorkspaceParams"
  33. | "DeleteWorkspaceRequest"
  34. | "DeleteWorkspaceParams"
  35. | "CreateWorkspaceRequest"
  36. | "CreateWorkspaceParams"
  37. | "Workspace"
  38. | "RepeatedWorkspace"
  39. | "QueryWorkspaceRequest"
  40. | "QueryWorkspaceParams"
  41. | "CurrentWorkspace"
  42. | "UpdateViewRequest"
  43. | "UpdateViewParams"
  44. | "SaveViewDataRequest"
  45. | "ApplyChangesetRequest"
  46. | "DeleteViewRequest"
  47. | "DeleteViewParams"
  48. | "QueryViewRequest"
  49. | "QueryViewParams"
  50. | "OpenViewRequest"
  51. | "CreateViewRequest"
  52. | "CreateViewParams"
  53. | "View"
  54. | "RepeatedView"
  55. | "WorkspaceError"
  56. | "WsError"
  57. | "CreateDocParams"
  58. | "Doc"
  59. | "SaveDocParams"
  60. | "ApplyChangesetParams"
  61. | "QueryDocParams"
  62. | "DocError"
  63. | "FFIRequest"
  64. | "FFIResponse"
  65. | "SignInRequest"
  66. | "SignInParams"
  67. | "SignInResponse"
  68. | "SignUpRequest"
  69. | "SignUpParams"
  70. | "SignUpResponse"
  71. | "UserToken"
  72. | "UserProfile"
  73. | "UpdateUserRequest"
  74. | "UpdateUserParams"
  75. | "UserError"
  76. => TypeCategory::Protobuf,
  77. "ViewType"
  78. | "WorkspaceEvent"
  79. | "ErrorCode"
  80. | "WorkspaceObservable"
  81. | "DocObservable"
  82. | "FFIStatusCode"
  83. | "UserStatus"
  84. | "UserEvent"
  85. | "UserObservable"
  86. => TypeCategory::Enum,
  87. "Option" => TypeCategory::Opt,
  88. _ => TypeCategory::Primitive,
  89. }
  90. }