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 engine::ENV_VARIABLE_ID;
- pub use engine::IN_VARIABLE_ID;
- pub use engine::NU_VARIABLE_ID;
- pub use ast::unit::*;
- 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
- casing
- 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 Evaltrait allowing dispatch between const-eval and regular evaluation
- eval_const 
- Implementation of const-evaluation
- ir
- list_stream 
- Module managing the streaming of individual Values as aListStreambetween pipeline elements
- marker
- parser_path 
- process
- Handling of external subprocesses
- record
- Our insertion ordered map-type Record
- report_error 
- This module manages the step of turning error types into printed error messages
- shell_error 
- shell_warning 
- span
- Spanto point to sections of source code and the- Spannedwrapper type
Macros§
Structs§
- Alias
- Command wrapper of an alias.
- ByteStream 
- A potentially infinite, interruptible stream of bytes.
- Chunks
- Turn a readable stream into Values.
- CustomExample 
- DeprecationEntry 
- A entry which indicates that some part of, or all of, a command is deprecated
- DidYouMean 
- ErrorLabel 
- A labeled span within a LabeledError.
- Example
- Filesize
- A signed number of bytes.
- FilesizeFormatter 
- A configurable formatter for Filesizes.
- Flag
- The signature definition of a named flag that either accepts a value or acts as a toggle flag
- FloatRange 
- FormattedFilesize 
- The resulting struct from calling FilesizeFormatter::formaton aFilesize.
- HandlerGuard 
- HandlerGuard that unregisters a handler when dropped.
- Handlers
- Manages a collection of handlers.
- Id
- IntRange
- IntoIter 
- InvalidPlugin Filename 
- 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
- ParseFilesize Unit Error 
- The error returned when failing to parse a FilesizeUnit.
- ParseFilesize Unit Format Error 
- The error returned when failing to parse a FilesizeUnitFormat.
- PipelineExecution Data 
- A wrapper to PipelineDatawhich can also track exit status.
- 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.
- PluginRegistry File 
- PluginRegistry Item 
- 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
- ResolvedImport Pattern 
- Signals
- Used to check for signals to suspend or terminate the execution of Nushell code.
- Signature
- Signature information of a Command
- SplitRead 
- TryFromFloat Error 
- The error type returned when a checked conversion from a floating point type fails.
Enums§
- ByteStream Source 
- The source of bytes for a ByteStream.
- ByteStream Type 
- Optional type color for ByteStream, which determines type compatibility.
- Category
- Command categories
- CommandWide Completer 
- CompileError 
- An internal compiler error, generally means a Nushell bug rather than an issue with user error since parsing and typechecking has already passed.
- Completion
- ConfigError 
- The errors that may occur when updating the config
- ConfigWarning 
- Warnings which don’t prevent config from being loaded, but we should inform the user about
- DataSource 
- Describes where the particular PipelineMetadataoriginates.
- DeprecationType 
- What this deprecation affects
- FilesizeUnit 
- All the possible filesize units for a Filesize.
- FilesizeUnit Format 
- The different file size unit display formats for a FilesizeFormatter.
- MultiLife 
- NuGlob
- OutDest
- Describes where to direct the stdout or stderr output stream of external command to.
- Parameter
- ParseError 
- ParseWarning 
- PipelineData 
- The foundational abstraction for input and output to commands
- PluginRegistry Item Data 
- Possibly valid data about a plugin in a PluginRegistryFile. If deserialization fails, it will beInvalid.
- Range
- ReportMode 
- How a warning/error should be reported
- 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.
- ShellWarning 
- 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.
Constants§
Traits§
- CustomValue 
- Trait definition for a custom Valuetype
- FromValue 
- A trait for loading a value from a Value.
- IntoInterruptible Pipeline Data 
- IntoPipeline Data 
- IntoValue 
- A trait for converting a value into a Value.
- RegisteredPlugin 
- Trait for plugins registered in the EngineState.
- Reportable
- For warnings/errors which have a ReportMode that dictates when they are reported
- TryIntoValue 
- A trait for trying to convert a value into a Value.
Functions§
- category_from_ string 
- combined_type_ string 
- Get a string nicely combining multiple types
- copy_with_ signals 
- did_you_ mean 
- format_cli_ error 
- format_duration 
- format_duration_ as_ timeperiod 
- human_time_ from_ now 
- levenshtein_distance 
- Finds the Levenshtein distance between two strings.
- report_parse_ error 
- report_parse_ warning 
- report_shell_ error 
- report_shell_ warning 
- write_all_ and_ flush 
Type Aliases§
- BlockId
- DeclId
- FileId
- Handler
- Handler is a closure that can be sent across threads and shared.
- JobId
- ModuleId 
- OverlayId 
- RegId
- An ID for an IR register.
- SpanId
- ValueIterator 
- VarId
- VirtualPath Id