Skip to main content

Crate flow_types

Crate flow_types 

Source
Expand description

The declaration model Flow’s types are written in, with no values: the types a value crosses the host boundary at (Type), the declarations they name (Decl, each known by its Identity in the module its ModulePath names), the shapes a record or enum value shares with its declaration (RecordShape, EnumShape), the judgment of which types decoding may build and which values may cross (judge), and the index decoding finds a declared name by under a Spelling (NameIndex).

The value model (flow-lang-value) builds its records and enums on these shapes, and the value encoding (flow-abi) keeps its declarations in a catalog of these and judges them with this kernel, which the checker judges a program’s types with too. normal_path is std’s path.Path normal form, which a declaration’s library is written in, and LibraryLayout is the one layout of a library’s files.

Macros§

members
Declares a closed Members enum: a std declaration’s constructors or fields that a Rust rule reads, each by the name the declaration gives it.

Structs§

Constructor
One constructor of an enum declaration.
Decl
A declared type.
DeclId
A declaration’s place in the catalog that holds it (flow-abi’s Catalog).
EnumShape
An enum declaration: its name and its constructors in declaration order.
Identity
A declaration’s identity: where it lives and its name (abi.md, Identity and signatures). Written library@tag/module.Name for a remote library, std@v1/module.Name for std and library/module.Name for a local one, without /module for a library’s root module, and path.Name for a module outside every library, from its tree.
LibraryLayout
The layout of a library’s files (modules.md, Libraries): a directory holding MARKER is a library’s root, a module path P names <root>/P.flow or <root>/contract/P.flow, and the root module, whose module path is empty, is lib.flow or contract/lib.flow.
MemberDoc
The doc comments of a record’s field or an enum’s constructor.
Mismatch
A std declaration that lacks a member a Rust rule reads: std’s sources and the Rust that reads them disagree, a bug in this implementation that the bundled std’s tests hold away.
ModulePath
Where a module is, as a code.ModulePath writes it (code.md, Programs and modules): its tree, the root of the library it belongs to in that tree, and its module path in that library. A module outside every library has no library, and its path is its file’s from the tree’s root, without .flow.
NameIndex
A declaration’s names by their key under one Spelling: a record’s fields, or an enum’s constructors and each constructor’s named payload fields, each mapped to its position in declaration order.
RecordShape
A record declaration: its name and its fields in declaration order.
Refusal
The first part of a type a judgment refuses, what it is, and the way from the judged type down to it.
Segments
Names joined by /: a module path inside a library, a library’s root inside its tree, or a file’s path inside its tree without its .flow. The empty path is a library’s root module, or a tree’s own root.
SegmentsError
Text that is no path: a name in it is empty, as a//b, /a and a/ make one.
Settings
What a judgment asks of every part of a type.
SharedKey
Two names one scope of a declaration declares that share a key.
StdEnum
A std enum’s constructors of C, each with its declaration index.
StdRecord
A std record’s fields of F, each with its position.

Enums§

Body
What a declaration declares.
Builtin
A built-in encoding form, the head of a Type that names no catalog declaration.
BundleError
Why a code.Bundle is no bundle of files.
CallField
task.Call’s fields.
CodeStepCtor
code.Step’s constructors.
Crossing
Whether a type crosses a boundary, which refuses an Option<json.Value> part, since None and Some(Null) would be written the same way (tools.md, Runtime-shaped data). Each variant asks more than the one before it.
DecodeErrorField
json.DecodeError’s fields.
Head
A Type by its head: a built-in form with its arguments, or one of the heads a catalog declaration, a tuple, a function, a parameter or a type that is not data. Every type has exactly one, so a reader of types matches a head once and names no built-in form it does not mean.
JsonNamesCtor
json.Names’s constructors.
JsonProblemCtor
json.Problem’s constructors.
JsonStepCtor
json.Step’s constructors.
JsonValueCtor
json.Value’s constructors.
OptionCtor
Option’s constructors.
Payload
What a constructor carries.
Placement
Which of the two files of one module path in a library holds the module: the authored <root>/P.flow or the contract <root>/contract/P.flow.
Reason
What the part a judgment refuses is.
ResultCtor
Result’s constructors.
Role
A type a compiler rule names by the role std marks it with.
Shape
The shape a role’s declaration has, when it is a record or an enum.
SourcePath
A module’s file as history records its source (history.md, Programs): std@v1/<file>, <repository>@<version>/<file>, ./<file> for the local tree, each file without its extension, or <name> for a lone submitted file. Its text is its Display, which FromStr reads back.
SourcePathError
Why text is no SourcePath.
Spelled
A module path written inside a library that spells the library’s layout rather than a module, and so names none (modules.md, Libraries).
Spelling
How a name the JSON writes is compared with the names a type declares.
Step
One step from a type down to a part of it.
StopCtor
task.Stop’s constructors.
ToolProblemCtor
ToolProblem’s constructors.
Tree
The tree a module is in, as a code.Tree writes it: std, a repository by its host path, or the local tree or bundle a program was formed from.
Type
A type, as the encoding sees it.
TypeMismatchField
code.TypeMismatch’s fields.
Versions
Whether a declaration’s name is written with its repository version.

Constants§

KEYWORDS
Flow’s keywords, which no name may spell (grammar.md).
STD_TYPES
Every public type std declares, as its module’s path in std and its name.

Traits§

Fold
A walk Nested::fold makes something of a tree of N with.
Members
The members of one std declaration that a Rust rule reads: its constructors or its fields, as a closed enum. members! declares one.
Nested
A tree whose nodes each hold their parts, nested to no bound.

Functions§

bundled_file
The file, from a bundle’s root, of the module of its local tree whose library is library, "." for the root, and whose path inside it is segments, and the directory of its library, "" for the root, when it is in one. A module outside every library is <segments>.flow from the root; a library’s module is its contract module <library>/contract/<segments>.flow, contract/lib.flow for its root module.
judge
Judges ty, a type over decls, where the nth is DeclId n, against settings, passing each type parameter it reaches, with the settings it is reached under, to on_param. Returns the first part refused.
lowercase_name
Whether text is a Flow lowercase name that is no keyword, as each name of a module path is.
normal_path
The normal text of the path text names: text split on /, without its empty and . components and keeping every .., joined by / after a / when text starts with one; ., or / when absolute, when no component is left. Every text names a path, so this never fails.