Expand description
§nu-protocol
The nu-protocol crate holds the definitions of structs/traits that are used throughout Nushell. This gives us one way to expose them to many other crates, as well as make these definitions available to each other, without causing mutually recursive dependencies.
Re-exports§
pub use ast::Unit;
pub use engine::ENV_VARIABLE_ID;
pub use engine::IN_VARIABLE_ID;
pub use engine::NU_VARIABLE_ID;
pub use config::*;
pub use span::*;
Modules§
- ast
- Types representing parsed Nushell code (the Abstract Syntax Tree)
- byte_
stream - Module managing the streaming of raw bytes between pipeline elements
- cli_
error - This module manages the step of turning error types into printed error messages
- config
- Module containing the internal representation of user configuration
- debugger
- Module containing the trait to instrument the engine for debugging and profiling
- engine
- Representation of the engine state and many of the details that implement the scoping
- eval_
base - Foundational
Eval
trait allowing dispatch between const-eval and regular evaluation - eval_
const - Implementation of const-evaluation
- format
- ir
- list_
stream - Module managing the streaming of individual
Value
s as aListStream
between pipeline elements - marker
- parser_
path - process
- Handling of external subprocesses
- record
- Our insertion ordered map-type
Record
- shell_
error - span
Span
to point to sections of source code and theSpanned
wrapper type
Macros§
Structs§
- Alias
- Command wrapper of an alias.
- Byte
Stream - A potentially infinite, interruptible stream of bytes.
- Chunks
- Turn a readable stream into
Value
s. - DidYou
Mean - Display
Filesize - Error
Label - A labeled span within a
LabeledError
. - Example
- Filesize
- A signed number of bytes.
- Flag
- The signature definition of a named flag that either accepts a value or acts as a toggle flag
- Float
Range - Handler
Guard - HandlerGuard that unregisters a handler when dropped.
- Handlers
- Manages a collection of handlers.
- Id
- IntRange
- Into
Iter - Invalid
Plugin Filename - Error when an invalid plugin filename was encountered.
- Labeled
Error - A very generic type of error used for interfacing with external code, such as scripts and plugins.
- Lines
- List
Stream - A potentially infinite, interruptible stream of
Value
s. - Module
- Collection of definitions that can be exported from a module
- Parse
Filesize Unit Error - The error returned when failing to parse a
FilesizeUnit
. - Pipeline
Iterator - Pipeline
Metadata - Metadata that is valid for the whole
PipelineData
- Plugin
Example - Plugin
Identity - Plugin
Metadata - Metadata about the installed plugin. This is cached in the registry file along with the signatures. None of the metadata fields are required, and more may be added in the future.
- Plugin
Registry File - Plugin
Registry Item - A single plugin definition from a
PluginRegistryFile
. - Plugin
Signature - A simple wrapper for Signature that includes examples.
- Positional
Arg - The signature definition for a positional argument
- Reader
- Record
- Resolved
Import Pattern - Signals
- Used to check for signals to suspend or terminate the execution of Nushell code.
- Signature
- Signature information of a
Command
- Split
Read - TryFrom
Float Error - The error type returned when a checked conversion from a floating point type fails.
Enums§
- Byte
Stream Source - The source of bytes for a
ByteStream
. - Byte
Stream Type - Optional type color for
ByteStream
, which determines type compatibility. - Category
- Command categories
- Compile
Error - An internal compiler error, generally means a Nushell bug rather than an issue with user error since parsing and typechecking has already passed.
- Config
Error - The errors that may occur when updating the config
- Data
Source - Describes where the particular
PipelineMetadata
originates. - Filesize
Unit - All the possible filesize units for a
Filesize
. - NuGlob
- OutDest
- Describes where to direct the stdout or stderr output stream of external command to.
- Parse
Error - Parse
Warning - Pipeline
Data - The foundational abstraction for input and output to commands
- Plugin
Registry Item Data - Possibly valid data about a plugin in a
PluginRegistryFile
. If deserialization fails, it will beInvalid
. - Range
- Shell
Error - The fundamental error type for the evaluation engine. These cases represent different kinds of errors the evaluator might face, along with helpful spans to label. An error renderer will take this error value and pass it into an error viewer to display to the user.
- Signal
Action - The types of things that can be signaled. It’s anticipated this will change as we learn more about how we’d like signals to be handled.
- Syntax
Shape - The syntactic shapes that describe how a sequence should be parsed.
- Time
Period - Type
- Value
- Core structured values that pass through the pipeline in Nushell.
Traits§
- Custom
Value - Trait definition for a custom
Value
type - From
Value - A trait for loading a value from a
Value
. - Into
Interruptible Pipeline Data - Into
Pipeline Data - Into
Value - A trait for converting a value into a
Value
. - Registered
Plugin - Trait for plugins registered in the
EngineState
. - TryInto
Value - A trait for trying to convert a value into a
Value
.
Functions§
- copy_
with_ signals - did_
you_ mean - format_
duration - format_
duration_ as_ timeperiod - format_
shell_ error - levenshtein_
distance - Finds the Levenshtein distance between two strings.
- report_
parse_ error - report_
parse_ warning - report_
shell_ error - report_
shell_ warning
Type Aliases§
- BlockId
- DeclId
- FileId
- Handler
- Handler is a closure that can be sent across threads and shared.
- Module
Id - Overlay
Id - RegId
- An ID for an IR register.
- SpanId
- Value
Iterator - VarId
- Virtual
Path Id