repo stringlengths 6 65 | file_url stringlengths 81 311 | file_path stringlengths 6 227 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:31:58 2026-01-04 20:25:31 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/errors/compile_error.rs | crates/nu-protocol/src/errors/compile_error.rs | use crate::{RegId, Span};
use miette::Diagnostic;
use serde::{Deserialize, Serialize};
use thiserror::Error;
/// An internal compiler error, generally means a Nushell bug rather than an issue with user error
/// since parsing and typechecking has already passed.
#[derive(Debug, Clone, Error, Diagnostic, PartialEq, Ser... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/errors/chained_error.rs | crates/nu-protocol/src/errors/chained_error.rs | use super::shell_error::ShellError;
use crate::Span;
use miette::{LabeledSpan, Severity, SourceCode};
use thiserror::Error;
/// An error struct that contains source errors.
///
/// However, it's a bit special; if the error is constructed for the first time using
/// [`ChainedError::new`], it will behave the same as th... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/errors/labeled_error.rs | crates/nu-protocol/src/errors/labeled_error.rs | use super::{ShellError, shell_error::io::IoError};
use crate::{FromValue, IntoValue, Span, Type, Value, record};
use miette::{Diagnostic, LabeledSpan, NamedSource, SourceSpan};
use serde::{Deserialize, Serialize};
use std::{fmt, fs};
// # use nu_protocol::{FromValue, Value, ShellError, record, Span};
/// A very gener... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/errors/parse_warning.rs | crates/nu-protocol/src/errors/parse_warning.rs | use crate::Span;
use miette::Diagnostic;
use std::hash::Hash;
use thiserror::Error;
use crate::{ReportMode, Reportable};
#[derive(Clone, Debug, Error, Diagnostic)]
#[diagnostic(severity(Warning))]
pub enum ParseWarning {
/// A parse-time deprecation. Indicates that something will be removed in a future release.
... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/errors/mod.rs | crates/nu-protocol/src/errors/mod.rs | mod chained_error;
mod compile_error;
mod config;
mod labeled_error;
mod parse_error;
mod parse_warning;
mod short_handler;
pub mod report_error;
pub mod shell_error;
pub mod shell_warning;
pub use compile_error::CompileError;
pub use config::{ConfigError, ConfigWarning};
pub use labeled_error::{ErrorLabel, ErrorSour... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/errors/parse_error.rs | crates/nu-protocol/src/errors/parse_error.rs | use crate::{Span, Type, ast::RedirectionSource, did_you_mean};
use miette::Diagnostic;
use serde::{Deserialize, Serialize};
use std::{
fmt::Display,
str::{Utf8Error, from_utf8},
};
use thiserror::Error;
#[derive(Clone, Debug, Error, Diagnostic, Serialize, Deserialize)]
pub enum ParseError {
/// The parser ... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/errors/shell_error/io.rs | crates/nu-protocol/src/errors/shell_error/io.rs | #[cfg(doc)] // allow mentioning this in doc comments
use super::ShellError;
use miette::{Diagnostic, LabeledSpan, SourceSpan};
use std::{
error::Error as StdError,
fmt::{self, Display, Formatter},
path::{Path, PathBuf},
};
use thiserror::Error;
use crate::Span;
use super::location::Location;
/// Alias fo... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/errors/shell_error/network.rs | crates/nu-protocol/src/errors/shell_error/network.rs | use miette::{Diagnostic, LabeledSpan};
use thiserror::Error;
use crate::{ShellError, Span, Spanned};
#[derive(Debug, Clone, PartialEq, Error, Diagnostic)]
pub enum NetworkError {
// Replace ShellError::NetworkFailure with this one
#[error("Network failure")]
#[diagnostic(code(nu::shell::network))]
Gen... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/errors/shell_error/bridge.rs | crates/nu-protocol/src/errors/shell_error/bridge.rs | use super::ShellError;
use serde::{Deserialize, Serialize};
use thiserror::Error;
/// A bridge for transferring a [`ShellError`] between Nushell or similar processes.
///
/// This newtype encapsulates a [`ShellError`] to facilitate its transfer between Nushell processes
/// or processes with similar behavior.
/// By d... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/errors/shell_error/mod.rs | crates/nu-protocol/src/errors/shell_error/mod.rs | use super::chained_error::ChainedError;
use crate::{
ConfigError, FromValue, LabeledError, ParseError, Span, Spanned, Type, Value,
ast::Operator,
engine::{Stack, StateWorkingSet},
format_cli_error, record,
};
use job::JobError;
use miette::{Diagnostic, LabeledSpan, NamedSource};
use serde::{Deserialize,... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | true |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/errors/shell_error/location.rs | crates/nu-protocol/src/errors/shell_error/location.rs | use thiserror::Error;
/// Represents a specific location in the Rust code.
///
/// This data structure is used to provide detailed information about where in the Rust code
/// an error occurred.
/// While most errors in [`ShellError`](super::ShellError) are related to user-provided Nushell
/// code, some originate fro... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/errors/shell_error/job.rs | crates/nu-protocol/src/errors/shell_error/job.rs | use miette::Diagnostic;
use thiserror::Error;
use crate::{JobId, Span};
/// Errors when working working with jobs.
#[derive(Debug, Clone, Copy, PartialEq, Error, Diagnostic)]
pub enum JobError {
#[error("Job {id} not found")]
#[diagnostic(
code(nu::shell::job::not_found),
help(
"Th... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/value/filesize.rs | crates/nu-protocol/src/value/filesize.rs | use crate::{FromValue, IntoValue, ShellError, Span, Type, Value};
use num_format::{Locale, WriteFormatted};
use serde::{Deserialize, Serialize};
use std::{
char,
fmt::{self, Write},
iter::Sum,
ops::{Add, Mul, Neg, Sub},
str::FromStr,
};
use thiserror::Error;
pub const SUPPORTED_FILESIZE_UNITS: [&st... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/value/range.rs | crates/nu-protocol/src/value/range.rs | //! A Range is an iterator over integers or floats.
use crate::{ShellError, Signals, Span, Value, ast::RangeInclusion};
use core::ops::Bound;
use serde::{Deserialize, Serialize};
use std::{cmp::Ordering, fmt::Display};
mod int_range {
use crate::{FromValue, ShellError, Signals, Span, Value, ast::RangeInclusion};
... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/value/test_derive.rs | crates/nu-protocol/src/value/test_derive.rs | use crate::{FromValue, IntoValue, Record, Span, Value, record};
use bytes::Bytes;
use std::collections::HashMap;
// Make nu_protocol available in this namespace, consumers of this crate will
// have this without such an export.
// The derive macro fully qualifies paths to "nu_protocol".
use crate as nu_protocol;
trai... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/value/glob.rs | crates/nu-protocol/src/value/glob.rs | use serde::Deserialize;
use std::fmt::Display;
// Introduce this `NuGlob` enum rather than using `Value::Glob` directlry
// So we can handle glob easily without considering too much variant of `Value` enum.
#[derive(Debug, Clone, Deserialize)]
pub enum NuGlob {
/// Don't expand the glob pattern, normally it includ... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/value/custom_value.rs | crates/nu-protocol/src/value/custom_value.rs | use std::{cmp::Ordering, fmt, path::Path};
use crate::{ShellError, Span, Spanned, Type, Value, ast::Operator, casing::Casing};
/// Trait definition for a custom [`Value`](crate::Value) type
#[typetag::serde(tag = "type")]
pub trait CustomValue: fmt::Debug + Send + Sync {
/// Custom `Clone` implementation
///
... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/value/into_value.rs | crates/nu-protocol/src/value/into_value.rs | use crate::{Range, Record, ShellError, Span, Value, ast::CellPath, engine::Closure};
use chrono::{DateTime, FixedOffset};
use std::{
borrow::{Borrow, Cow},
collections::HashMap,
};
/// A trait for converting a value into a [`Value`].
///
/// This conversion is infallible, for fallible conversions use [`TryInto... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/value/record.rs | crates/nu-protocol/src/value/record.rs | //! Our insertion ordered map-type [`Record`]
use std::{
iter::FusedIterator,
marker::PhantomData,
ops::{Deref, DerefMut, RangeBounds},
};
use crate::{
ShellError, Span, Value,
casing::{CaseInsensitive, CaseSensitive, CaseSensitivity, Casing, WrapCased},
};
use serde::{Deserialize, Serialize, de::... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/value/mod.rs | crates/nu-protocol/src/value/mod.rs | mod custom_value;
mod duration;
mod filesize;
mod from_value;
mod glob;
mod into_value;
mod range;
#[cfg(test)]
mod test_derive;
pub mod record;
pub use custom_value::CustomValue;
pub use duration::*;
pub use filesize::*;
pub use from_value::FromValue;
pub use glob::*;
pub use into_value::{IntoValue, TryIntoValue};
pu... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | true |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/value/from_value.rs | crates/nu-protocol/src/value/from_value.rs | use crate::{
NuGlob, Range, Record, ShellError, Span, Spanned, Type, Value,
ast::{CellPath, PathMember},
casing::Casing,
engine::Closure,
};
use chrono::{DateTime, FixedOffset};
use std::{
any,
borrow::Cow,
cmp::Ordering,
collections::{HashMap, VecDeque},
fmt,
num::{
NonZ... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/value/duration.rs | crates/nu-protocol/src/value/duration.rs | use chrono::Duration;
use std::{
borrow::Cow,
fmt::{Display, Formatter},
};
#[derive(Clone, Copy)]
pub enum TimePeriod {
Nanos(i64),
Micros(i64),
Millis(i64),
Seconds(i64),
Minutes(i64),
Hours(i64),
Days(i64),
Weeks(i64),
Months(i64),
Years(i64),
}
impl TimePeriod {
... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/config/datetime_format.rs | crates/nu-protocol/src/config/datetime_format.rs | use super::prelude::*;
use crate as nu_protocol;
#[derive(Clone, Debug, Default, IntoValue, Serialize, Deserialize)]
pub struct DatetimeFormatConfig {
pub normal: Option<String>,
pub table: Option<String>,
}
impl UpdateFromValue for DatetimeFormatConfig {
fn update<'a>(
&mut self,
value: &... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/config/prelude.rs | crates/nu-protocol/src/config/prelude.rs | pub(super) use super::{ConfigPath, UpdateFromValue, error::ConfigErrors};
pub use crate::{IntoValue, ShellError, ShellWarning, Span, Type, Value, record};
pub use serde::{Deserialize, Serialize};
pub use std::str::FromStr;
| rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/config/filesize.rs | crates/nu-protocol/src/config/filesize.rs | use super::prelude::*;
use crate::{Filesize, FilesizeFormatter, FilesizeUnitFormat, FormattedFilesize};
use nu_utils::get_system_locale;
impl IntoValue for FilesizeUnitFormat {
fn into_value(self, span: Span) -> Value {
self.as_str().into_value(span)
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Ser... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/config/ls.rs | crates/nu-protocol/src/config/ls.rs | use super::prelude::*;
use crate as nu_protocol;
#[derive(Clone, Copy, Debug, IntoValue, PartialEq, Eq, Serialize, Deserialize)]
pub struct LsConfig {
pub use_ls_colors: bool,
pub clickable_links: bool,
}
impl Default for LsConfig {
fn default() -> Self {
Self {
use_ls_colors: true,
... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/config/ansi_coloring.rs | crates/nu-protocol/src/config/ansi_coloring.rs | use super::{ConfigErrors, ConfigPath, IntoValue, ShellError, UpdateFromValue, Value};
use crate::{self as nu_protocol, FromValue, engine::EngineState};
use serde::{Deserialize, Serialize};
use std::io::IsTerminal;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, IntoValue, Serialize, Deserialize)]
pub enum UseAnsi... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/config/rm.rs | crates/nu-protocol/src/config/rm.rs | use super::prelude::*;
use crate as nu_protocol;
#[derive(Clone, Copy, Debug, IntoValue, PartialEq, Eq, Serialize, Deserialize)]
pub struct RmConfig {
pub always_trash: bool,
}
#[allow(clippy::derivable_impls)]
impl Default for RmConfig {
fn default() -> Self {
Self {
always_trash: false,
... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/config/table.rs | crates/nu-protocol/src/config/table.rs | use std::{num::NonZeroU16, time::Duration};
use super::{config_update_string_enum, prelude::*};
use crate::{self as nu_protocol, ConfigError, FromValue};
#[derive(Clone, Copy, Debug, Default, IntoValue, PartialEq, Eq, Serialize, Deserialize)]
pub enum TableMode {
Basic,
Thin,
Light,
Compact,
WithL... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/config/error.rs | crates/nu-protocol/src/config/error.rs | use super::ConfigPath;
use crate::{Config, ConfigError, ConfigWarning, ShellError, ShellWarning, Span, Type, Value};
#[derive(Debug)]
#[must_use]
pub(super) struct ConfigErrors<'a> {
config: &'a Config,
errors: Vec<ConfigError>,
warnings: Vec<ConfigWarning>,
}
impl<'a> ConfigErrors<'a> {
pub fn new(co... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/config/helper.rs | crates/nu-protocol/src/config/helper.rs | use super::error::ConfigErrors;
use crate::{Record, ShellError, Span, Type, Value};
use std::{
borrow::Borrow,
collections::HashMap,
fmt::{self, Display},
hash::Hash,
ops::{Deref, DerefMut},
str::FromStr,
};
pub(super) struct ConfigPath<'a> {
components: Vec<&'a str>,
}
impl<'a> ConfigPath... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/config/history.rs | crates/nu-protocol/src/config/history.rs | use super::{config_update_string_enum, prelude::*};
use crate::{self as nu_protocol, ConfigWarning};
#[derive(Clone, Copy, Debug, IntoValue, PartialEq, Eq, Serialize, Deserialize)]
pub enum HistoryFileFormat {
/// Store history as an SQLite database with additional context
Sqlite,
/// store history as a pl... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/config/hooks.rs | crates/nu-protocol/src/config/hooks.rs | use super::prelude::*;
use crate as nu_protocol;
use std::collections::HashMap;
/// Definition of a parsed hook from the config object
#[derive(Clone, Debug, IntoValue, PartialEq, Serialize, Deserialize)]
pub struct Hooks {
pub pre_prompt: Vec<Value>,
pub pre_execution: Vec<Value>,
pub env_change: HashMap<... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/config/mod.rs | crates/nu-protocol/src/config/mod.rs | //! Module containing the internal representation of user configuration
use crate::FromValue;
use crate::{self as nu_protocol};
use helper::*;
use prelude::*;
use std::collections::HashMap;
pub use ansi_coloring::UseAnsiColoring;
pub use completions::{
CompletionAlgorithm, CompletionConfig, CompletionSort, Extern... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/config/completions.rs | crates/nu-protocol/src/config/completions.rs | use super::{config_update_string_enum, prelude::*};
use crate as nu_protocol;
use crate::engine::Closure;
#[derive(Clone, Copy, Debug, Default, IntoValue, PartialEq, Eq, Serialize, Deserialize)]
pub enum CompletionAlgorithm {
#[default]
Prefix,
Substring,
Fuzzy,
}
impl FromStr for CompletionAlgorithm ... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/config/plugin_gc.rs | crates/nu-protocol/src/config/plugin_gc.rs | use super::prelude::*;
use crate as nu_protocol;
use std::collections::HashMap;
/// Configures when plugins should be stopped if inactive
#[derive(Clone, Debug, Default, IntoValue, PartialEq, Eq, Serialize, Deserialize)]
pub struct PluginGcConfigs {
/// The config to use for plugins not otherwise specified
pub... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/config/output.rs | crates/nu-protocol/src/config/output.rs | use super::{config_update_string_enum, prelude::*};
use crate::{self as nu_protocol};
#[derive(Clone, Copy, Debug, IntoValue, PartialEq, Eq, Serialize, Deserialize)]
pub enum ErrorStyle {
Fancy,
Plain,
Short,
}
impl FromStr for ErrorStyle {
type Err = &'static str;
fn from_str(s: &str) -> Result... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/config/reedline.rs | crates/nu-protocol/src/config/reedline.rs | use super::{config_update_string_enum, prelude::*};
use crate as nu_protocol;
use crate::{FromValue, engine::Closure};
/// Definition of a parsed keybinding from the config object
#[derive(Clone, Debug, FromValue, IntoValue, Serialize, Deserialize)]
pub struct ParsedKeybinding {
pub name: Option<Value>,
pub mo... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/config/shell_integration.rs | crates/nu-protocol/src/config/shell_integration.rs | use super::prelude::*;
use crate as nu_protocol;
#[derive(Clone, Copy, Debug, IntoValue, PartialEq, Eq, Serialize, Deserialize)]
pub struct ShellIntegrationConfig {
pub osc2: bool,
pub osc7: bool,
pub osc8: bool,
pub osc9_9: bool,
pub osc133: bool,
pub osc633: bool,
pub reset_application_mo... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/config/display_errors.rs | crates/nu-protocol/src/config/display_errors.rs | use super::prelude::*;
use crate as nu_protocol;
use crate::ShellError;
#[derive(Clone, Copy, Debug, IntoValue, PartialEq, Eq, Serialize, Deserialize)]
pub struct DisplayErrors {
pub exit_code: bool,
pub termination_signal: bool,
}
impl DisplayErrors {
pub fn should_show(&self, error: &ShellError) -> bool... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/engine/argument.rs | crates/nu-protocol/src/engine/argument.rs | use std::sync::Arc;
use crate::{Span, Value, ast::Expression, ir::DataSlice};
/// Represents a fully evaluated argument to a call.
#[derive(Debug, Clone)]
pub enum Argument {
/// A positional argument
Positional {
span: Span,
val: Value,
ast: Option<Arc<Expression>>,
},
/// A s... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/engine/jobs.rs | crates/nu-protocol/src/engine/jobs.rs | use std::{
collections::{BTreeMap, BTreeSet, HashMap, HashSet},
sync::{
Arc, Mutex,
mpsc::{Receiver, RecvTimeoutError, Sender, TryRecvError},
},
};
#[cfg(not(target_family = "wasm"))]
use std::time::{Duration, Instant};
use nu_system::{UnfreezeHandle, kill_by_pid};
use crate::{PipelineDat... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/engine/variable.rs | crates/nu-protocol/src/engine/variable.rs | use crate::{Span, Type, Value};
#[derive(Clone, Debug)]
pub struct Variable {
pub declaration_span: Span,
pub ty: Type,
pub mutable: bool,
pub const_val: Option<Value>,
}
impl Variable {
pub fn new(declaration_span: Span, ty: Type, mutable: bool) -> Variable {
Self {
declaratio... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/engine/sequence.rs | crates/nu-protocol/src/engine/sequence.rs | use crate::ShellError;
use std::sync::atomic::{AtomicUsize, Ordering::Relaxed};
/// Implements an atomically incrementing sequential series of numbers
#[derive(Debug, Default)]
pub struct Sequence(AtomicUsize);
impl Sequence {
/// Return the next available id from a sequence, returning an error on overflow
#[... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/engine/command.rs | crates/nu-protocol/src/engine/command.rs | use serde::{Deserialize, Serialize};
use super::{EngineState, Stack, StateWorkingSet};
use crate::{
Alias, BlockId, DeprecationEntry, DynamicCompletionCallRef, DynamicSuggestion, Example,
OutDest, PipelineData, ShellError, Signature, Value, engine::Call,
};
use std::{borrow::Cow, fmt::Display};
#[derive(Debug... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/engine/call.rs | crates/nu-protocol/src/engine/call.rs | use crate::{
DeclId, FromValue, ShellError, Span, Value,
ast::{self, Expression},
ir,
};
use super::{EngineState, Stack, StateWorkingSet};
/// This is a HACK to help [`Command`](super::Command) support both the old AST evaluator and the
/// new IR evaluator at the same time. It should be removed once we a... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/engine/call_info.rs | crates/nu-protocol/src/engine/call_info.rs | use crate::{Span, ast::Call};
#[derive(Debug, Clone)]
pub struct UnevaluatedCallInfo {
pub args: Call,
pub name_span: Span,
}
| rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/engine/stack_out_dest.rs | crates/nu-protocol/src/engine/stack_out_dest.rs | use crate::{OutDest, engine::Stack};
use std::{
fs::File,
mem,
ops::{Deref, DerefMut},
sync::Arc,
};
#[derive(Debug, Clone)]
pub enum Redirection {
/// A pipe redirection.
///
/// This will only affect the last command of a block.
/// This is created by pipes and pipe redirections (`|`,... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/engine/state_delta.rs | crates/nu-protocol/src/engine/state_delta.rs | use crate::{
Module, Span,
ast::Block,
engine::{
CachedFile, Command, EngineState, OverlayFrame, ScopeFrame, Variable, VirtualPath,
description::Doccomments,
},
};
use std::sync::Arc;
#[cfg(feature = "plugin")]
use crate::{PluginRegistryItem, RegisteredPlugin};
/// A delta (or change s... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/engine/closure.rs | crates/nu-protocol/src/engine/closure.rs | use std::borrow::Cow;
use crate::{BlockId, ShellError, Span, Value, VarId, engine::EngineState};
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct Closure {
pub block_id: BlockId,
pub captures: Vec<(VarId, Value)>,
}
impl Closure {
pub fn coerce_into_string<... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/engine/mod.rs | crates/nu-protocol/src/engine/mod.rs | //! Representation of the engine state and many of the details that implement the scoping
mod argument;
mod cached_file;
mod call;
mod call_info;
mod closure;
mod command;
mod description;
mod engine_state;
mod error_handler;
mod jobs;
mod overlay;
mod pattern_match;
mod sequence;
mod stack;
mod stack_out_dest;
mod sta... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/engine/stack.rs | crates/nu-protocol/src/engine/stack.rs | use crate::{
Config, ENV_VARIABLE_ID, IntoValue, NU_VARIABLE_ID, OutDest, ShellError, Span, Value, VarId,
engine::{
ArgumentStack, DEFAULT_OVERLAY_NAME, EngineState, ErrorHandlerStack, Redirection,
StackCallArgGuard, StackCollectValueGuard, StackIoGuard, StackOutDest,
},
report_shell_war... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | true |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/engine/overlay.rs | crates/nu-protocol/src/engine/overlay.rs | use crate::{DeclId, ModuleId, OverlayId, VarId};
use std::collections::HashMap;
pub static DEFAULT_OVERLAY_NAME: &str = "zero";
/// Tells whether a decl is visible or not
#[derive(Debug, Clone)]
pub struct Visibility {
decl_ids: HashMap<DeclId, bool>,
}
impl Visibility {
pub fn new() -> Self {
Visibi... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/engine/cached_file.rs | crates/nu-protocol/src/engine/cached_file.rs | use crate::Span;
use std::sync::Arc;
/// Unit of cached source code
#[derive(Clone)]
pub struct CachedFile {
// Use Arcs of slice types for more compact representation (capacity less)
// Could possibly become an `Arc<PathBuf>`
/// The file name with which the code is associated (also includes REPL input)
... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/engine/error_handler.rs | crates/nu-protocol/src/engine/error_handler.rs | use crate::RegId;
/// Describes an error handler stored during IR evaluation.
#[derive(Debug, Clone, Copy)]
pub struct ErrorHandler {
/// Instruction index within the block that will handle the error
pub handler_index: usize,
/// Register to put the error information into, when an error occurs
pub erro... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/engine/pattern_match.rs | crates/nu-protocol/src/engine/pattern_match.rs | use crate::{
Span, Value, VarId,
ast::{Expr, MatchPattern, Pattern, RangeInclusion},
};
pub trait Matcher {
fn match_value(&self, value: &Value, matches: &mut Vec<(VarId, Value)>) -> bool;
}
impl Matcher for MatchPattern {
fn match_value(&self, value: &Value, matches: &mut Vec<(VarId, Value)>) -> bool... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/engine/description.rs | crates/nu-protocol/src/engine/description.rs | use crate::{ModuleId, Span};
use std::collections::HashMap;
/// Organizes documentation comments for various primitives
#[derive(Debug, Clone)]
pub(super) struct Doccomments {
// TODO: Move decl doccomments here
module_comments: HashMap<ModuleId, Vec<Span>>,
}
impl Doccomments {
pub fn new() -> Self {
... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/engine/state_working_set.rs | crates/nu-protocol/src/engine/state_working_set.rs | use crate::{
BlockId, Category, CompileError, Config, DeclId, FileId, GetSpan, Module, ModuleId, OverlayId,
ParseError, ParseWarning, ResolvedImportPattern, Signature, Span, SpanId, Type, Value, VarId,
VirtualPathId,
ast::Block,
engine::{
CachedFile, Command, CommandType, EngineState, Overla... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | true |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/engine/engine_state.rs | crates/nu-protocol/src/engine/engine_state.rs | use crate::{
BlockId, Config, DeclId, FileId, GetSpan, Handlers, HistoryConfig, JobId, Module, ModuleId,
OverlayId, ShellError, SignalAction, Signals, Signature, Span, SpanId, Type, Value, VarId,
VirtualPathId,
ast::Block,
debugger::{Debugger, NoopDebugger},
engine::{
CachedFile, Command... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | true |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/ast/attribute.rs | crates/nu-protocol/src/ast/attribute.rs | use super::Expression;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Attribute {
pub expr: Expression,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AttributeBlock {
pub attributes: Vec<Attribute>,
pub item: Box<Express... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/ast/value_with_unit.rs | crates/nu-protocol/src/ast/value_with_unit.rs | use super::Expression;
use crate::{Spanned, Unit};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ValueWithUnit {
pub expr: Expression,
pub unit: Spanned<Unit>,
}
| rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/ast/expr.rs | crates/nu-protocol/src/ast/expr.rs | use chrono::FixedOffset;
use serde::{Deserialize, Serialize};
use super::{
AttributeBlock, Call, CellPath, Expression, ExternalArgument, FullCellPath, Keyword,
MatchPattern, Operator, Range, Table, ValueWithUnit,
};
use crate::{
BlockId, ModuleId, OutDest, Signature, Span, VarId, ast::ImportPattern, engine... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/ast/range.rs | crates/nu-protocol/src/ast/range.rs | use super::{Expression, RangeOperator};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Range {
pub from: Option<Expression>,
pub next: Option<Expression>,
pub to: Option<Expression>,
pub operator: RangeOperator,
}
| rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/ast/call.rs | crates/nu-protocol/src/ast/call.rs | use std::collections::HashMap;
use serde::{Deserialize, Serialize};
use crate::{
DeclId, FromValue, ShellError, Span, Spanned, Value, ast::Expression, engine::StateWorkingSet,
eval_const::eval_constant,
};
/// Parsed command arguments
///
/// Primarily for internal commands
#[derive(Debug, Clone, PartialEq, ... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/ast/unit.rs | crates/nu-protocol/src/ast/unit.rs | use crate::{Filesize, FilesizeUnit, IntoValue, ShellError, Span, Value};
use serde::{Deserialize, Serialize};
use std::fmt;
use std::str::FromStr;
use thiserror::Error;
pub const SUPPORTED_DURATION_UNITS: [&str; 9] =
["ns", "us", "µs", "ms", "sec", "min", "hr", "day", "wk"];
/// The error returned when failing to... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/ast/import_pattern.rs | crates/nu-protocol/src/ast/import_pattern.rs | use serde::{Deserialize, Serialize};
use crate::{ModuleId, Span, VarId};
use std::collections::HashSet;
/// possible patterns after the first module level in an [`ImportPattern`].
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub enum ImportPatternMember {
/// Wildcard import of items
Glob { ... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/ast/match_pattern.rs | crates/nu-protocol/src/ast/match_pattern.rs | use super::Expression;
use crate::{Span, Value, VarId};
use serde::{Deserialize, Serialize};
/// AST Node for match arm with optional match guard
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct MatchPattern {
pub pattern: Pattern,
pub guard: Option<Box<Expression>>,
pub span: Span,
}
... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/ast/table.rs | crates/nu-protocol/src/ast/table.rs | use super::Expression;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Table {
pub columns: Box<[Expression]>,
pub rows: Box<[Box<[Expression]>]>,
}
| rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/ast/keyword.rs | crates/nu-protocol/src/ast/keyword.rs | use super::Expression;
use crate::Span;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Keyword {
pub keyword: Box<[u8]>,
pub span: Span,
pub expr: Expression,
}
| rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/ast/block.rs | crates/nu-protocol/src/ast/block.rs | use super::Pipeline;
use crate::{OutDest, Signature, Span, Type, VarId, engine::StateWorkingSet, ir::IrBlock};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Block {
pub signature: Box<Signature>,
pub pipelines: Vec<Pipeline>,
pub captures: Vec<(VarId, Span)... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/ast/expression.rs | crates/nu-protocol/src/ast/expression.rs | use crate::{
BlockId, GetSpan, IN_VARIABLE_ID, Signature, Span, SpanId, Type, VarId,
ast::{Argument, Block, Expr, ExternalArgument, ImportPattern, MatchPattern, RecordItem},
engine::StateWorkingSet,
};
use serde::{Deserialize, Serialize};
use std::sync::Arc;
use super::ListItem;
/// Wrapper around [`Expr`... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/ast/operator.rs | crates/nu-protocol/src/ast/operator.rs | use super::{Expr, Expression};
use crate::{ShellError, Span};
use serde::{Deserialize, Serialize};
use std::fmt;
use strum_macros::{EnumIter, EnumMessage};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, EnumIter, EnumMessage)]
pub enum Comparison {
#[strum(message = "Equal to")]
Equal,
... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/ast/mod.rs | crates/nu-protocol/src/ast/mod.rs | //! Types representing parsed Nushell code (the Abstract Syntax Tree)
mod attribute;
mod block;
mod call;
mod cell_path;
mod expr;
mod expression;
mod import_pattern;
mod keyword;
mod match_pattern;
mod operator;
mod pipeline;
mod range;
mod table;
mod traverse;
pub mod unit;
mod value_with_unit;
pub use attribute::*;... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/ast/traverse.rs | crates/nu-protocol/src/ast/traverse.rs | use crate::engine::StateWorkingSet;
use super::{
Block, Expr, Expression, ListItem, MatchPattern, Pattern, PipelineRedirection, RecordItem,
};
/// Result of find_map closure
#[derive(Default)]
pub enum FindMapResult<T> {
Found(T),
#[default]
Continue,
Stop,
}
/// Trait for traversing the AST
pub ... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/ast/pipeline.rs | crates/nu-protocol/src/ast/pipeline.rs | use crate::{OutDest, Span, VarId, ast::Expression, engine::StateWorkingSet};
use serde::{Deserialize, Serialize};
use std::fmt::Display;
#[derive(Debug, Clone, Copy, Serialize, Deserialize, Eq, PartialEq)]
pub enum RedirectionSource {
Stdout,
Stderr,
StdoutAndStderr,
}
impl Display for RedirectionSource {... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/ast/cell_path.rs | crates/nu-protocol/src/ast/cell_path.rs | use super::Expression;
use crate::{Span, casing::Casing};
use nu_utils::{escape_quote_string, needs_quoting};
use serde::{Deserialize, Serialize};
use std::{cmp::Ordering, fmt::Display};
/// One level of access of a [`CellPath`]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum PathMember {
/// Accessing a ... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/debugger/profiler.rs | crates/nu-protocol/src/debugger/profiler.rs | //! Nushell Profiler
//!
//! Profiler implements the Debugger trait and can be used via the `debug profile` command for
//! profiling Nushell code.
use crate::{
PipelineData, PipelineExecutionData, ShellError, Span, Value,
ast::{Block, Expr, PipelineElement},
debugger::Debugger,
engine::EngineState,
... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/debugger/mod.rs | crates/nu-protocol/src/debugger/mod.rs | //! Module containing the trait to instrument the engine for debugging and profiling
pub mod debugger_trait;
pub mod profiler;
pub use debugger_trait::*;
pub use profiler::*;
| rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/debugger/debugger_trait.rs | crates/nu-protocol/src/debugger/debugger_trait.rs | //! Traits related to debugging
//!
//! The purpose of DebugContext is achieving static dispatch on `eval_xxx()` calls.
//! The main Debugger trait is intended to be used as a trait object.
//!
//! The debugging information is stored in `EngineState` as the `debugger` field storing a `Debugger`
//! trait object behind ... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/pipeline/byte_stream.rs | crates/nu-protocol/src/pipeline/byte_stream.rs | //! Module managing the streaming of raw bytes between pipeline elements
//!
//! This module also handles conversions the [`ShellError`] <-> [`io::Error`](std::io::Error),
//! so remember the usage of [`ShellErrorBridge`] where applicable.
#[cfg(feature = "os")]
use crate::process::{ChildPipe, ChildProcess};
use crate:... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | true |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/pipeline/handlers.rs | crates/nu-protocol/src/pipeline/handlers.rs | use std::fmt::Debug;
use std::sync::{Arc, Mutex};
use crate::{ShellError, SignalAction, engine::Sequence};
/// Handler is a closure that can be sent across threads and shared.
pub type Handler = Box<dyn Fn(SignalAction) + Send + Sync>;
/// Manages a collection of handlers.
#[derive(Clone)]
pub struct Handlers {
... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/pipeline/list_stream.rs | crates/nu-protocol/src/pipeline/list_stream.rs | //! Module managing the streaming of individual [`Value`]s as a [`ListStream`] between pipeline
//! elements
//!
//! For more general infos regarding our pipelining model refer to [`PipelineData`]
use crate::{Config, PipelineData, ShellError, Signals, Span, Value};
use std::fmt::Debug;
pub type ValueIterator = Box<dyn... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/pipeline/pipeline_data.rs | crates/nu-protocol/src/pipeline/pipeline_data.rs | #[cfg(feature = "os")]
use crate::process::ExitStatusFuture;
use crate::{
ByteStream, ByteStreamSource, ByteStreamType, Config, ListStream, OutDest, PipelineMetadata,
Range, ShellError, Signals, Span, Type, Value,
ast::{Call, PathMember},
engine::{EngineState, Stack},
location,
shell_error::{io:... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | true |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/pipeline/mod.rs | crates/nu-protocol/src/pipeline/mod.rs | pub mod byte_stream;
mod handlers;
pub mod list_stream;
mod metadata;
mod out_dest;
mod pipeline_data;
mod signals;
pub use byte_stream::*;
pub use handlers::*;
pub use list_stream::*;
pub use metadata::*;
pub use out_dest::*;
pub use pipeline_data::*;
pub use signals::*;
| rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/pipeline/out_dest.rs | crates/nu-protocol/src/pipeline/out_dest.rs | use std::{fs::File, io, process::Stdio, sync::Arc};
/// Describes where to direct the stdout or stderr output stream of external command to.
#[derive(Debug, Clone)]
pub enum OutDest {
/// Redirect the stdout and/or stderr of one command as the input for the next command in the pipeline.
///
/// The output ... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/pipeline/metadata.rs | crates/nu-protocol/src/pipeline/metadata.rs | use std::path::PathBuf;
use serde::{Deserialize, Serialize};
use crate::Record;
/// Metadata that is valid for the whole [`PipelineData`](crate::PipelineData)
///
/// ## Custom Metadata
///
/// The `custom` field allows commands and plugins to attach arbitrary metadata to pipeline data.
/// To avoid key collisions, ... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/src/pipeline/signals.rs | crates/nu-protocol/src/pipeline/signals.rs | use crate::{ShellError, Span};
use nu_glob::Interruptible;
use serde::{Deserialize, Serialize};
use std::sync::{
Arc,
atomic::{AtomicBool, Ordering},
};
/// Used to check for signals to suspend or terminate the execution of Nushell code.
///
/// For now, this struct only supports interruption (ctrl+c or SIGINT... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/tests/into_config.rs | crates/nu-protocol/tests/into_config.rs | use nu_test_support::{nu, nu_repl_code};
#[test]
fn config_is_mutable() {
let actual = nu!(nu_repl_code(&[
r"$env.config = { ls: { clickable_links: true } }",
"$env.config.ls.clickable_links = false;",
"$env.config.ls.clickable_links"
]));
assert_eq!(actual.out, "false");
}
#[test... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/tests/test_value.rs | crates/nu-protocol/tests/test_value.rs | use nu_protocol::{
Config, Span, Value,
engine::{EngineState, Stack},
};
use rstest::rstest;
#[test]
fn test_comparison_nothing() {
let values = vec![
Value::test_int(1),
Value::test_string("string"),
Value::test_float(1.0),
];
let nothing = Value::nothing(Span::test_data()... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/tests/test_signature.rs | crates/nu-protocol/tests/test_signature.rs | use nu_protocol::{Flag, PositionalArg, Signature, SyntaxShape};
#[test]
fn test_signature() {
let signature = Signature::new("new_signature");
let from_build = Signature::build("new_signature");
// asserting partial eq implementation
assert_eq!(signature, from_build);
// constructing signature wi... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/tests/mod.rs | crates/nu-protocol/tests/mod.rs | mod pipeline;
| rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/tests/test_config.rs | crates/nu-protocol/tests/test_config.rs | use nu_test_support::{nu, nu_repl_code};
#[test]
fn filesize_mb() {
let code = &[
r#"$env.config = { filesize: { unit: MB } }"#,
r#"20MB | into string"#,
];
let actual = nu!(nu_repl_code(code));
assert_eq!(actual.out, "20.0 MB");
}
#[test]
fn filesize_mib() {
let code = &[
... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/tests/test_pipeline_data.rs | crates/nu-protocol/tests/test_pipeline_data.rs | use nu_protocol::{IntoPipelineData, Span, Value};
#[test]
fn test_convert_pipeline_data_to_value() {
// Setup PipelineData
let value_val = 10;
let value = Value::int(value_val, Span::new(1, 3));
let pipeline_data = value.into_pipeline_data();
// Test that conversion into Value is correct
let n... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/tests/pipeline/byte_stream.rs | crates/nu-protocol/tests/pipeline/byte_stream.rs | use nu_protocol::{ByteStream, IntRange, Signals, Span, Value, ast::RangeInclusion};
#[test]
pub fn test_simple_positive_slice_exclusive() {
let data = b"Hello World".to_vec();
let stream = ByteStream::read_binary(data, Span::test_data(), Signals::empty());
let sliced = stream
.slice(
Sp... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-protocol/tests/pipeline/mod.rs | crates/nu-protocol/tests/pipeline/mod.rs | mod byte_stream;
| rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-plugin/src/lib.rs | crates/nu-cmd-plugin/src/lib.rs | //! Nushell commands for managing plugins.
mod commands;
mod default_context;
mod util;
pub use commands::*;
pub use default_context::*;
| rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-plugin/src/default_context.rs | crates/nu-cmd-plugin/src/default_context.rs | use crate::*;
use nu_protocol::engine::{EngineState, StateWorkingSet};
pub fn add_plugin_command_context(mut engine_state: EngineState) -> EngineState {
let delta = {
let mut working_set = StateWorkingSet::new(&engine_state);
macro_rules! bind_command {
( $( $command:expr ),* $(,)? ) =... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-plugin/src/util.rs | crates/nu-cmd-plugin/src/util.rs | #[allow(deprecated)]
use nu_engine::{command_prelude::*, current_dir};
use nu_protocol::{
PluginRegistryFile,
engine::StateWorkingSet,
shell_error::{
self,
io::{IoError, IoErrorExt, NotFound},
},
};
use std::{
fs::{self, File},
path::PathBuf,
};
fn get_plugin_registry_file_path(... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-plugin/src/commands/mod.rs | crates/nu-cmd-plugin/src/commands/mod.rs | mod plugin;
pub use plugin::*;
| rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
nushell/nushell | https://github.com/nushell/nushell/blob/6d3cb27fa40b324a1168c577aee7f3532a5e157e/crates/nu-cmd-plugin/src/commands/plugin/use_.rs | crates/nu-cmd-plugin/src/commands/plugin/use_.rs | use nu_engine::command_prelude::*;
use nu_protocol::engine::CommandType;
#[derive(Clone)]
pub struct PluginUse;
impl Command for PluginUse {
fn name(&self) -> &str {
"plugin use"
}
fn description(&self) -> &str {
"Load a plugin from the plugin registry file into scope."
}
fn sign... | rust | MIT | 6d3cb27fa40b324a1168c577aee7f3532a5e157e | 2026-01-04T15:32:17.606688Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.