nushell/crates/nu-command/src
Devyn Cairns 73f3c0b60b
Support for all custom value operations on plugin custom values (#12088)
# Description

Adds support for the following operations on plugin custom values, in
addition to `to_base_value` which was already present:

- `follow_path_int()`
- `follow_path_string()`
- `partial_cmp()`
- `operation()`
- `Drop` (notification, if opted into with
`CustomValue::notify_plugin_on_drop`)

There are additionally customizable methods within the `Plugin` and
`StreamingPlugin` traits for implementing these functions in a way that
requires access to the plugin state, as a registered handle model such
as might be used in a dataframes plugin would.

`Value::append` was also changed to handle custom values correctly.

# User-Facing Changes

- Signature of `CustomValue::follow_path_string` and
`CustomValue::follow_path_int` changed to give access to the span of the
custom value itself, useful for some errors.
- Plugins using custom values have to be recompiled because the engine
will try to do custom value operations that aren't supported
- Plugins can do more things 🎉 

# Tests + Formatting
Tests were added for all of the new custom values functionality.

- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`

# After Submitting
- [ ] Document protocol reference `CustomValueOp` variants:
  - [ ] `FollowPathInt`
  - [ ] `FollowPathString`
  - [ ] `PartialCmp`
  - [ ] `Operation`
  - [ ] `Dropped`
- [ ] Document `notify_on_drop` optional field in `PluginCustomValue`
2024-03-12 10:37:08 +01:00
..
bytes Debugger experiments (#11441) 2024-03-08 20:21:35 +02:00
charting Remove Record::from_raw_cols_vals_unchecked (#11810) 2024-02-18 14:20:22 +02:00
conversions Glob: don't allow implicit casting between glob and string (#11992) 2024-02-28 23:05:35 +08:00
database Support for all custom value operations on plugin custom values (#12088) 2024-03-12 10:37:08 +01:00
date Adjust examples in date commands (#12055) 2024-03-03 15:10:50 -06:00
debug Fix ignored clippy lints (#12160) 2024-03-11 19:46:04 +01:00
env Debugger experiments (#11441) 2024-03-08 20:21:35 +02:00
experimental Bump windows from 0.48.0 to 0.52.0 (#11325) 2023-12-21 18:49:15 +01:00
filesystem Fix ignored clippy lints (#12160) 2024-03-11 19:46:04 +01:00
filters Fix ignored clippy lints (#12160) 2024-03-11 19:46:04 +01:00
formats Fix: string_to_table in ssv.rs now filters comments. (issue #11997) (#12035) 2024-03-01 07:11:13 -06:00
generators Debugger experiments (#11441) 2024-03-08 20:21:35 +02:00
hash adjust some commansd input_output type (#11436) 2024-01-15 16:58:26 +08:00
help Fix ignored clippy lints (#12160) 2024-03-11 19:46:04 +01:00
math allow math avg to work with durations (#11598) 2024-01-21 08:41:23 -06:00
misc Debugger experiments (#11441) 2024-03-08 20:21:35 +02:00
network Fix ignored clippy lints (#12160) 2024-03-11 19:46:04 +01:00
path Add Value::coerce_str (#11885) 2024-02-18 17:47:10 +01:00
platform Improve sleep resolution (#12049) 2024-03-02 14:03:56 -06:00
random Name the Value conversion functions more clearly (#11851) 2024-02-17 18:14:16 +00:00
removed Enforce required, optional, and rest positional arguments start with an uppercase and end with a period. (#11285) 2023-12-15 14:32:37 +08:00
shells Enforce required, optional, and rest positional arguments start with an uppercase and end with a period. (#11285) 2023-12-15 14:32:37 +08:00
stor Add Value::coerce_str (#11885) 2024-02-18 17:47:10 +01:00
strings Fix ignored clippy lints (#12160) 2024-03-11 19:46:04 +01:00
system Refactor nu-check (#12137) 2024-03-09 18:58:02 +02:00
viewers Fix ignored clippy lints (#12160) 2024-03-11 19:46:04 +01:00
default_context.rs Debugger experiments (#11441) 2024-03-08 20:21:35 +02:00
example_test.rs Add interleave command for reading multiple streams in parallel (#11955) 2024-03-01 16:56:37 -06:00
lib.rs Simplify the feature gates for stor commands (#11416) 2023-12-24 13:31:46 +01:00
progress_bar.rs remove cp-old (#11622) 2024-01-24 07:38:15 +08:00
sort_utils.rs Add Value::coerce_str (#11885) 2024-02-18 17:47:10 +01:00