nushell/crates/nu_plugin_formats
Ian Manske 7f61cbbfd6
Add Filesize type (#14369)
# Description
Adds a new `Filesize` type so that `FromValue` can be used to convert a
`Value::Filesize` to a `Filesize`. Currently, to extract a filesize from
a `Value` using `FromValue`, you have to extract an `i64` which coerces
`Value::Int`, `Value::Duration`, and `Value::Filesize` to an `i64`.

Having a separate type also allows us to enforce checked math to catch
overflows. Similarly, it allows us to specify other trait
implementations like `Display` in a common place.

# User-Facing Changes
Multiplication with filesizes now error on overflow. Should not be a
breaking change for plugins (i.e., serialization) since `Filesize` is
marked with `serde(transparent)`.

# Tests + Formatting
Updated some tests.
2024-11-29 21:24:17 +00:00
..
src Add Filesize type (#14369) 2024-11-29 21:24:17 +00:00
Cargo.toml Bump to dev version 0.100.1 (#14328) 2024-11-14 10:04:39 +01:00
README.md remove the deprecated register command (#13297) 2024-07-05 07:16:50 -05:00

nu_plugin_formats

A nushell plugin to convert data to nushell tables.

support commands:

  1. from eml - original ported from nushell core.
  2. from ics - original ported from nushell core.
  3. from ini - original ported from nushell core.
  4. from vcf - original ported from nushell core.

Prerequisite

nushell, It's a nushell plugin, so you need it.

Usage

  1. compile the binary: cargo build
  2. plugin add plugin(assume it's compiled in ./target/debug/):
plugin add ./target/debug/nu_plugin_formats