Skip to main content

Crate flowjs_rs

Crate flowjs_rs 

Source
Expand description

Generate Flow type declarations from Rust types.

§Usage

#[derive(flowjs_rs::Flow)]
struct User {
    user_id: i32,
    first_name: String,
    last_name: String,
}

When running cargo test, the following Flow type will be exported:

type User = {|
  +user_id: number,
  +first_name: string,
  +last_name: string,
|};

Modules§

flow_type
Flow built-in type names.

Structs§

Config
Configuration for Flow type generation.
Dependency
A Flow type which is depended upon by other types. This information is required for generating the correct import statements.
Dummy
Dummy type used as a placeholder for generic parameters during codegen.

Enums§

ExportError
Export error.

Traits§

Flow
The core trait. Derive it on your types to generate Flow declarations.
TypeVisitor
A visitor used to iterate over all dependencies or generics of a type. When an instance of TypeVisitor is passed to Flow::visit_dependencies or Flow::visit_generics, the TypeVisitor::visit method will be invoked for every dependency or generic parameter respectively.

Derive Macros§

Flow
Derive the Flow trait for a struct or enum.