Crate nu_protocol

Source
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 Values as a ListStream 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 the Spanned wrapper type

Macros§

location
Macro to create a new Location for the exact position in your code.
record

Structs§

Alias
Command wrapper of an alias.
ByteStream
A potentially infinite, interruptible stream of bytes.
Chunks
Turn a readable stream into Values.
DidYouMean
DisplayFilesize
ErrorLabel
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
FloatRange
HandlerGuard
HandlerGuard that unregisters a handler when dropped.
Handlers
Manages a collection of handlers.
Id
IntRange
IntoIter
InvalidPluginFilename
Error when an invalid plugin filename was encountered.
LabeledError
A very generic type of error used for interfacing with external code, such as scripts and plugins.
Lines
ListStream
A potentially infinite, interruptible stream of Values.
Module
Collection of definitions that can be exported from a module
ParseFilesizeUnitError
The error returned when failing to parse a FilesizeUnit.
PipelineIterator
PipelineMetadata
Metadata that is valid for the whole PipelineData
PluginExample
PluginIdentity
PluginMetadata
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.
PluginRegistryFile
PluginRegistryItem
A single plugin definition from a PluginRegistryFile.
PluginSignature
A simple wrapper for Signature that includes examples.
PositionalArg
The signature definition for a positional argument
Reader
Record
ResolvedImportPattern
Signals
Used to check for signals to suspend or terminate the execution of Nushell code.
Signature
Signature information of a Command
SplitRead
TryFromFloatError
The error type returned when a checked conversion from a floating point type fails.

Enums§

ByteStreamSource
The source of bytes for a ByteStream.
ByteStreamType
Optional type color for ByteStream, which determines type compatibility.
Category
Command categories
CompileError
An internal compiler error, generally means a Nushell bug rather than an issue with user error since parsing and typechecking has already passed.
ConfigError
The errors that may occur when updating the config
DataSource
Describes where the particular PipelineMetadata originates.
FilesizeUnit
All the possible filesize units for a Filesize.
NuGlob
OutDest
Describes where to direct the stdout or stderr output stream of external command to.
ParseError
ParseWarning
PipelineData
The foundational abstraction for input and output to commands
PluginRegistryItemData
Possibly valid data about a plugin in a PluginRegistryFile. If deserialization fails, it will be Invalid.
Range
ShellError
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.
SignalAction
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.
SyntaxShape
The syntactic shapes that describe how a sequence should be parsed.
TimePeriod
Type
Value
Core structured values that pass through the pipeline in Nushell.

Traits§

CustomValue
Trait definition for a custom Value type
FromValue
A trait for loading a value from a Value.
IntoInterruptiblePipelineData
IntoPipelineData
IntoValue
A trait for converting a value into a Value.
RegisteredPlugin
Trait for plugins registered in the EngineState.
TryIntoValue
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.
ModuleId
OverlayId
RegId
An ID for an IR register.
SpanId
ValueIterator
VarId
VirtualPathId

Derive Macros§

FromValue
Derive macro generating an impl of the trait FromValue.
IntoValue
Derive macro generating an impl of the trait IntoValue.