Skip to main content

Crate kcl_lib

Crate kcl_lib 

Source
Expand description

Rust support for KCL (aka the KittyCAD Language).

KCL is written in Rust. This crate contains the compiler tooling (e.g. parser, lexer, code generation), the standard library implementation, generator for the docs, and more.

Re-exports§

pub use kcl_error;

Modules§

collections
engine_connection
exec
front
lint
pretty
std
Functions implemented for language execution.
std_utils
test_server
Types used to send data to the test server.
unit_conversion
walk

Structs§

AstProgram
A KCL program top level, or function body.
AsyncTasks
BacktraceItem
CompilationIssue
An issue which occurred during parsing, etc. The severity determines whether it’s an error, warning, or other kind of issue.
CompilationIssueReport
Configuration
User specific settings for the app. These live in user.toml in the app’s configuration directory. Updating the settings in the app will update this file automatically. Do not edit this file manually, as it may be overwritten by the app. Manual edits can cause corruption of the settings file.
EdgeRefactorMeta
Metadata collected when a deprecated edge stdlib function runs, for refactor-to-edgeRefs lint/code mod.
EngineBatchContext
Per-execution buffer for modeling commands that must preserve temporal order.
EngineStats
EnvironmentRef
An index pointing to an environment at a point in time.
ExecOutcome
Outcome of executing a program. This is used in TS.
ExecState
State for executing a program.
ExecutorContext
The executor context. Cloning will return another handle to the same engine connection/session, as this uses Arc under the hood.
ExecutorSettings
The executor settings.
FormatOptions
Format options.
IMPORT_FILE_EXTENSIONS
InMemoryFiles
KclErrorWithOutputs
KclRuntimeFlags
Maps 1-1 to the KCL related flags added to the Admin portal and TS.
LegacyAngleRefactorMeta
Information needed to rewrite one legacy angle call while preserving its currently solved directed-angle branch.
MetaSettings
MockConfig
Configuration for mock execution.
ModuleId
Identifier of a source file. Uses a u32 to keep the size small.
NodePath
A traversal path through the AST to a node.
OperationCallbackArgs
Point2d
Program
ProjectConfiguration
Project specific settings for the app. These live in project.toml in the base of the project directory. Updating the settings for the project in the app will update this file automatically. Do not edit this file manually, as it may be overwritten by the app. Manual edits can cause corruption of the settings file.
ProjectManager
RELEVANT_FILE_EXTENSIONS
Report
ReportWithOutputs
SegmentDragAnchor
SketchConstraintReport
Grouped report of all sketches by constraint status.
SketchConstraintStatus
Per-sketch summary of constraint freedom analysis.
SourceRange
The first two items are the start and end points (byte offsets from the start of the file). The third item is whether the source range belongs to the ‘main’ file, i.e., the file currently being rendered/displayed in the editor.
TypedPath

Enums§

BacktraceItemKind
What kind of execution step a backtrace frame records.
ConnectionError
How did KCL client fail to connect to the engine
ConstraintKind
Overall constraint status of a sketch.
ExecError
How did the KCL execution fail
KclError
KclValueView
A serializable, presentational view of any KCL value.
KclVersion
Which KCL versions does Zoo support?
NodePathStep
RefactorMetadata
Unified metadata stream for Z0006 and future execution-backed refactors.
RuntimeFlag
Runtime representation for feature flags that can be set by the TS app.

Traits§

ExecutionCallbacks
FileSystem
IntoDiagnostic
Convert an object into LSP diagnostics for a source document.
IsRetryable
NodePathExt
ToLspRange

Functions§

bust_cache
clear_mem_cache
kcl_runtime_flags
new_file_system_handle
recast_dir
Recast all the kcl files in a directory, recursively.
render_compilation_issue_miette
Render a CompilationIssue as a miette report string, mirroring the formatting used for Report. The issue is rendered against the module its source range points into: issues from imported modules use their entry in source_files, while top-level issues use top_level_filename and top_level_source, since callers know the real top-level filename (e.g. an absolute path) while source_files only records the module path. The top-level pair is also the fallback when the module is missing from source_files, so callers without a source map can pass an empty one.
set_kcl_runtime_flags
version
Get the version of the KCL library.
walk_dir
Collect all the kcl (and other relevant) files in a directory, recursively.

Type Aliases§

FileSystemHandle
LspSuggestion