Extract core stuff into own crates
This commit extracts five new crates:
- nu-source, which contains the core source-code handling logic in Nu,
including Text, Span, and also the pretty.rs-based debug logic
- nu-parser, which is the parser and expander logic
- nu-protocol, which is the bulk of the types and basic conveniences
used by plugins
- nu-errors, which contains ShellError, ParseError and error handling
conveniences
- nu-textview, which is the textview plugin extracted into a crate
One of the major consequences of this refactor is that it's no longer
possible to `impl X for Spanned<Y>` outside of the `nu-source` crate, so
a lot of types became more concrete (Value became a concrete type
instead of Spanned<Value>, for example).
This also turned a number of inherent methods in the main nu crate into
plain functions (impl Value {} became a bunch of functions in the
`value` namespace in `crate::data::value`).
2019-11-26 02:30:48 +00:00
use crate ::maybe_owned ::MaybeOwned ;
use crate ::value ::primitive ::Primitive ;
use crate ::value ::{ UntaggedValue , Value } ;
use derive_new ::new ;
use getset ::Getters ;
use indexmap ::IndexMap ;
2020-04-30 04:18:24 +00:00
use nu_source ::{ b , DebugDocBuilder , PrettyDebug , Spanned , SpannedItem , Tag } ;
Extract core stuff into own crates
This commit extracts five new crates:
- nu-source, which contains the core source-code handling logic in Nu,
including Text, Span, and also the pretty.rs-based debug logic
- nu-parser, which is the parser and expander logic
- nu-protocol, which is the bulk of the types and basic conveniences
used by plugins
- nu-errors, which contains ShellError, ParseError and error handling
conveniences
- nu-textview, which is the textview plugin extracted into a crate
One of the major consequences of this refactor is that it's no longer
possible to `impl X for Spanned<Y>` outside of the `nu-source` crate, so
a lot of types became more concrete (Value became a concrete type
instead of Spanned<Value>, for example).
This also turned a number of inherent methods in the main nu crate into
plain functions (impl Value {} became a bunch of functions in the
`value` namespace in `crate::data::value`).
2019-11-26 02:30:48 +00:00
use serde ::{ Deserialize , Serialize } ;
use std ::cmp ::{ Ord , Ordering , PartialOrd } ;
2019-12-31 04:05:02 +00:00
use std ::hash ::{ Hash , Hasher } ;
Extract core stuff into own crates
This commit extracts five new crates:
- nu-source, which contains the core source-code handling logic in Nu,
including Text, Span, and also the pretty.rs-based debug logic
- nu-parser, which is the parser and expander logic
- nu-protocol, which is the bulk of the types and basic conveniences
used by plugins
- nu-errors, which contains ShellError, ParseError and error handling
conveniences
- nu-textview, which is the textview plugin extracted into a crate
One of the major consequences of this refactor is that it's no longer
possible to `impl X for Spanned<Y>` outside of the `nu-source` crate, so
a lot of types became more concrete (Value became a concrete type
instead of Spanned<Value>, for example).
This also turned a number of inherent methods in the main nu crate into
plain functions (impl Value {} became a bunch of functions in the
`value` namespace in `crate::data::value`).
2019-11-26 02:30:48 +00:00
2020-01-14 07:38:56 +00:00
/// A dictionary that can hold a mapping from names to Values
Extract core stuff into own crates
This commit extracts five new crates:
- nu-source, which contains the core source-code handling logic in Nu,
including Text, Span, and also the pretty.rs-based debug logic
- nu-parser, which is the parser and expander logic
- nu-protocol, which is the bulk of the types and basic conveniences
used by plugins
- nu-errors, which contains ShellError, ParseError and error handling
conveniences
- nu-textview, which is the textview plugin extracted into a crate
One of the major consequences of this refactor is that it's no longer
possible to `impl X for Spanned<Y>` outside of the `nu-source` crate, so
a lot of types became more concrete (Value became a concrete type
instead of Spanned<Value>, for example).
This also turned a number of inherent methods in the main nu crate into
plain functions (impl Value {} became a bunch of functions in the
`value` namespace in `crate::data::value`).
2019-11-26 02:30:48 +00:00
#[ derive(Debug, Default, Serialize, Deserialize, PartialEq, Eq, Clone, Getters, new) ]
pub struct Dictionary {
#[ get = " pub " ]
pub entries : IndexMap < String , Value > ,
}
2019-12-31 07:36:08 +00:00
#[ allow(clippy::derive_hash_xor_eq) ]
2019-12-31 04:05:02 +00:00
impl Hash for Dictionary {
2020-01-14 07:38:56 +00:00
/// Create the hash function to allow the Hash trait for dictionaries
2019-12-31 04:05:02 +00:00
fn hash < H : Hasher > ( & self , state : & mut H ) {
let mut entries = self . entries . clone ( ) ;
entries . sort_keys ( ) ;
entries . keys ( ) . collect ::< Vec < & String > > ( ) . hash ( state ) ;
entries . values ( ) . collect ::< Vec < & Value > > ( ) . hash ( state ) ;
}
}
Extract core stuff into own crates
This commit extracts five new crates:
- nu-source, which contains the core source-code handling logic in Nu,
including Text, Span, and also the pretty.rs-based debug logic
- nu-parser, which is the parser and expander logic
- nu-protocol, which is the bulk of the types and basic conveniences
used by plugins
- nu-errors, which contains ShellError, ParseError and error handling
conveniences
- nu-textview, which is the textview plugin extracted into a crate
One of the major consequences of this refactor is that it's no longer
possible to `impl X for Spanned<Y>` outside of the `nu-source` crate, so
a lot of types became more concrete (Value became a concrete type
instead of Spanned<Value>, for example).
This also turned a number of inherent methods in the main nu crate into
plain functions (impl Value {} became a bunch of functions in the
`value` namespace in `crate::data::value`).
2019-11-26 02:30:48 +00:00
impl PartialOrd for Dictionary {
2020-01-14 07:38:56 +00:00
/// Compare two dictionaries for sort ordering
Extract core stuff into own crates
This commit extracts five new crates:
- nu-source, which contains the core source-code handling logic in Nu,
including Text, Span, and also the pretty.rs-based debug logic
- nu-parser, which is the parser and expander logic
- nu-protocol, which is the bulk of the types and basic conveniences
used by plugins
- nu-errors, which contains ShellError, ParseError and error handling
conveniences
- nu-textview, which is the textview plugin extracted into a crate
One of the major consequences of this refactor is that it's no longer
possible to `impl X for Spanned<Y>` outside of the `nu-source` crate, so
a lot of types became more concrete (Value became a concrete type
instead of Spanned<Value>, for example).
This also turned a number of inherent methods in the main nu crate into
plain functions (impl Value {} became a bunch of functions in the
`value` namespace in `crate::data::value`).
2019-11-26 02:30:48 +00:00
fn partial_cmp ( & self , other : & Dictionary ) -> Option < Ordering > {
let this : Vec < & String > = self . entries . keys ( ) . collect ( ) ;
let that : Vec < & String > = other . entries . keys ( ) . collect ( ) ;
if this ! = that {
return this . partial_cmp ( & that ) ;
}
let this : Vec < & Value > = self . entries . values ( ) . collect ( ) ;
let that : Vec < & Value > = self . entries . values ( ) . collect ( ) ;
this . partial_cmp ( & that )
}
}
impl Ord for Dictionary {
2020-01-14 07:38:56 +00:00
/// Compare two dictionaries for ordering
Extract core stuff into own crates
This commit extracts five new crates:
- nu-source, which contains the core source-code handling logic in Nu,
including Text, Span, and also the pretty.rs-based debug logic
- nu-parser, which is the parser and expander logic
- nu-protocol, which is the bulk of the types and basic conveniences
used by plugins
- nu-errors, which contains ShellError, ParseError and error handling
conveniences
- nu-textview, which is the textview plugin extracted into a crate
One of the major consequences of this refactor is that it's no longer
possible to `impl X for Spanned<Y>` outside of the `nu-source` crate, so
a lot of types became more concrete (Value became a concrete type
instead of Spanned<Value>, for example).
This also turned a number of inherent methods in the main nu crate into
plain functions (impl Value {} became a bunch of functions in the
`value` namespace in `crate::data::value`).
2019-11-26 02:30:48 +00:00
fn cmp ( & self , other : & Dictionary ) -> Ordering {
let this : Vec < & String > = self . entries . keys ( ) . collect ( ) ;
let that : Vec < & String > = other . entries . keys ( ) . collect ( ) ;
if this ! = that {
return this . cmp ( & that ) ;
}
let this : Vec < & Value > = self . entries . values ( ) . collect ( ) ;
let that : Vec < & Value > = self . entries . values ( ) . collect ( ) ;
this . cmp ( & that )
}
}
impl PartialEq < Value > for Dictionary {
2020-01-14 07:38:56 +00:00
/// Test a dictionary against a Value for equality
Extract core stuff into own crates
This commit extracts five new crates:
- nu-source, which contains the core source-code handling logic in Nu,
including Text, Span, and also the pretty.rs-based debug logic
- nu-parser, which is the parser and expander logic
- nu-protocol, which is the bulk of the types and basic conveniences
used by plugins
- nu-errors, which contains ShellError, ParseError and error handling
conveniences
- nu-textview, which is the textview plugin extracted into a crate
One of the major consequences of this refactor is that it's no longer
possible to `impl X for Spanned<Y>` outside of the `nu-source` crate, so
a lot of types became more concrete (Value became a concrete type
instead of Spanned<Value>, for example).
This also turned a number of inherent methods in the main nu crate into
plain functions (impl Value {} became a bunch of functions in the
`value` namespace in `crate::data::value`).
2019-11-26 02:30:48 +00:00
fn eq ( & self , other : & Value ) -> bool {
match & other . value {
UntaggedValue ::Row ( d ) = > self = = d ,
_ = > false ,
}
}
}
2020-01-14 07:38:56 +00:00
/// A key-value pair specifically meant to be used in debug and pretty-printing
Extract core stuff into own crates
This commit extracts five new crates:
- nu-source, which contains the core source-code handling logic in Nu,
including Text, Span, and also the pretty.rs-based debug logic
- nu-parser, which is the parser and expander logic
- nu-protocol, which is the bulk of the types and basic conveniences
used by plugins
- nu-errors, which contains ShellError, ParseError and error handling
conveniences
- nu-textview, which is the textview plugin extracted into a crate
One of the major consequences of this refactor is that it's no longer
possible to `impl X for Spanned<Y>` outside of the `nu-source` crate, so
a lot of types became more concrete (Value became a concrete type
instead of Spanned<Value>, for example).
This also turned a number of inherent methods in the main nu crate into
plain functions (impl Value {} became a bunch of functions in the
`value` namespace in `crate::data::value`).
2019-11-26 02:30:48 +00:00
#[ derive(Debug, new) ]
struct DebugEntry < ' a > {
key : & ' a str ,
value : & ' a Value ,
}
impl < ' a > PrettyDebug for DebugEntry < ' a > {
2020-01-14 07:38:56 +00:00
/// Build the the information to pretty-print the DebugEntry
Extract core stuff into own crates
This commit extracts five new crates:
- nu-source, which contains the core source-code handling logic in Nu,
including Text, Span, and also the pretty.rs-based debug logic
- nu-parser, which is the parser and expander logic
- nu-protocol, which is the bulk of the types and basic conveniences
used by plugins
- nu-errors, which contains ShellError, ParseError and error handling
conveniences
- nu-textview, which is the textview plugin extracted into a crate
One of the major consequences of this refactor is that it's no longer
possible to `impl X for Spanned<Y>` outside of the `nu-source` crate, so
a lot of types became more concrete (Value became a concrete type
instead of Spanned<Value>, for example).
This also turned a number of inherent methods in the main nu crate into
plain functions (impl Value {} became a bunch of functions in the
`value` namespace in `crate::data::value`).
2019-11-26 02:30:48 +00:00
fn pretty ( & self ) -> DebugDocBuilder {
2019-12-07 09:34:32 +00:00
( b ::key ( self . key . to_string ( ) ) + b ::equals ( ) + self . value . pretty ( ) . into_value ( ) ) . group ( )
Extract core stuff into own crates
This commit extracts five new crates:
- nu-source, which contains the core source-code handling logic in Nu,
including Text, Span, and also the pretty.rs-based debug logic
- nu-parser, which is the parser and expander logic
- nu-protocol, which is the bulk of the types and basic conveniences
used by plugins
- nu-errors, which contains ShellError, ParseError and error handling
conveniences
- nu-textview, which is the textview plugin extracted into a crate
One of the major consequences of this refactor is that it's no longer
possible to `impl X for Spanned<Y>` outside of the `nu-source` crate, so
a lot of types became more concrete (Value became a concrete type
instead of Spanned<Value>, for example).
This also turned a number of inherent methods in the main nu crate into
plain functions (impl Value {} became a bunch of functions in the
`value` namespace in `crate::data::value`).
2019-11-26 02:30:48 +00:00
}
}
impl PrettyDebug for Dictionary {
2020-01-14 07:38:56 +00:00
/// Get a Dictionary ready to be pretty-printed
Extract core stuff into own crates
This commit extracts five new crates:
- nu-source, which contains the core source-code handling logic in Nu,
including Text, Span, and also the pretty.rs-based debug logic
- nu-parser, which is the parser and expander logic
- nu-protocol, which is the bulk of the types and basic conveniences
used by plugins
- nu-errors, which contains ShellError, ParseError and error handling
conveniences
- nu-textview, which is the textview plugin extracted into a crate
One of the major consequences of this refactor is that it's no longer
possible to `impl X for Spanned<Y>` outside of the `nu-source` crate, so
a lot of types became more concrete (Value became a concrete type
instead of Spanned<Value>, for example).
This also turned a number of inherent methods in the main nu crate into
plain functions (impl Value {} became a bunch of functions in the
`value` namespace in `crate::data::value`).
2019-11-26 02:30:48 +00:00
fn pretty ( & self ) -> DebugDocBuilder {
b ::delimit (
" ( " ,
b ::intersperse (
self . entries ( )
. iter ( )
. map ( | ( key , value ) | DebugEntry ::new ( key , value ) ) ,
b ::space ( ) ,
) ,
" ) " ,
)
}
}
impl From < IndexMap < String , Value > > for Dictionary {
2020-01-14 07:38:56 +00:00
/// Create a dictionary from a map of strings to Values
Extract core stuff into own crates
This commit extracts five new crates:
- nu-source, which contains the core source-code handling logic in Nu,
including Text, Span, and also the pretty.rs-based debug logic
- nu-parser, which is the parser and expander logic
- nu-protocol, which is the bulk of the types and basic conveniences
used by plugins
- nu-errors, which contains ShellError, ParseError and error handling
conveniences
- nu-textview, which is the textview plugin extracted into a crate
One of the major consequences of this refactor is that it's no longer
possible to `impl X for Spanned<Y>` outside of the `nu-source` crate, so
a lot of types became more concrete (Value became a concrete type
instead of Spanned<Value>, for example).
This also turned a number of inherent methods in the main nu crate into
plain functions (impl Value {} became a bunch of functions in the
`value` namespace in `crate::data::value`).
2019-11-26 02:30:48 +00:00
fn from ( input : IndexMap < String , Value > ) -> Dictionary {
let mut out = IndexMap ::default ( ) ;
for ( key , value ) in input {
out . insert ( key , value ) ;
}
Dictionary ::new ( out )
}
}
impl Dictionary {
2020-01-14 07:38:56 +00:00
/// Find the matching Value for a given key, if possible. If not, return a Primitive::Nothing
2019-12-31 07:36:08 +00:00
pub fn get_data ( & self , desc : & str ) -> MaybeOwned < '_ , Value > {
Extract core stuff into own crates
This commit extracts five new crates:
- nu-source, which contains the core source-code handling logic in Nu,
including Text, Span, and also the pretty.rs-based debug logic
- nu-parser, which is the parser and expander logic
- nu-protocol, which is the bulk of the types and basic conveniences
used by plugins
- nu-errors, which contains ShellError, ParseError and error handling
conveniences
- nu-textview, which is the textview plugin extracted into a crate
One of the major consequences of this refactor is that it's no longer
possible to `impl X for Spanned<Y>` outside of the `nu-source` crate, so
a lot of types became more concrete (Value became a concrete type
instead of Spanned<Value>, for example).
This also turned a number of inherent methods in the main nu crate into
plain functions (impl Value {} became a bunch of functions in the
`value` namespace in `crate::data::value`).
2019-11-26 02:30:48 +00:00
match self . entries . get ( desc ) {
Some ( v ) = > MaybeOwned ::Borrowed ( v ) ,
None = > MaybeOwned ::Owned (
UntaggedValue ::Primitive ( Primitive ::Nothing ) . into_untagged_value ( ) ,
) ,
}
}
2020-04-30 04:18:24 +00:00
pub fn merge_from ( & self , other : & Dictionary ) -> Dictionary {
let mut obj = self . clone ( ) ;
for column in other . keys ( ) {
let key = column . clone ( ) ;
let value_key = key . as_str ( ) ;
let value_spanned_key = value_key . spanned_unknown ( ) ;
let other_column = match other . get_data_by_key ( value_spanned_key ) {
Some ( value ) = > value ,
None = > UntaggedValue ::Primitive ( Primitive ::Nothing ) . into_untagged_value ( ) ,
} ;
obj . entries . insert ( key , other_column ) ;
}
obj
}
2020-01-14 07:38:56 +00:00
/// Iterate the keys in the Dictionary
Extract core stuff into own crates
This commit extracts five new crates:
- nu-source, which contains the core source-code handling logic in Nu,
including Text, Span, and also the pretty.rs-based debug logic
- nu-parser, which is the parser and expander logic
- nu-protocol, which is the bulk of the types and basic conveniences
used by plugins
- nu-errors, which contains ShellError, ParseError and error handling
conveniences
- nu-textview, which is the textview plugin extracted into a crate
One of the major consequences of this refactor is that it's no longer
possible to `impl X for Spanned<Y>` outside of the `nu-source` crate, so
a lot of types became more concrete (Value became a concrete type
instead of Spanned<Value>, for example).
This also turned a number of inherent methods in the main nu crate into
plain functions (impl Value {} became a bunch of functions in the
`value` namespace in `crate::data::value`).
2019-11-26 02:30:48 +00:00
pub fn keys ( & self ) -> impl Iterator < Item = & String > {
self . entries . keys ( )
}
2020-03-03 21:01:24 +00:00
/// Iterate the values in the Dictionary
pub fn values ( & self ) -> impl Iterator < Item = & Value > {
self . entries . values ( )
}
2020-01-28 07:10:15 +00:00
/// Checks if given key exists
pub fn contains_key ( & self , key : & str ) -> bool {
self . entries . contains_key ( key )
}
2020-01-14 07:38:56 +00:00
/// Find the matching Value for a key, if possible
Extract core stuff into own crates
This commit extracts five new crates:
- nu-source, which contains the core source-code handling logic in Nu,
including Text, Span, and also the pretty.rs-based debug logic
- nu-parser, which is the parser and expander logic
- nu-protocol, which is the bulk of the types and basic conveniences
used by plugins
- nu-errors, which contains ShellError, ParseError and error handling
conveniences
- nu-textview, which is the textview plugin extracted into a crate
One of the major consequences of this refactor is that it's no longer
possible to `impl X for Spanned<Y>` outside of the `nu-source` crate, so
a lot of types became more concrete (Value became a concrete type
instead of Spanned<Value>, for example).
This also turned a number of inherent methods in the main nu crate into
plain functions (impl Value {} became a bunch of functions in the
`value` namespace in `crate::data::value`).
2019-11-26 02:30:48 +00:00
pub fn get_data_by_key ( & self , name : Spanned < & str > ) -> Option < Value > {
let result = self
. entries
. iter ( )
. find ( | ( desc_name , _ ) | * desc_name = = name . item ) ?
. 1 ;
Some (
result
. value
. clone ( )
. into_value ( Tag ::new ( result . tag . anchor ( ) , name . span ) ) ,
)
}
2020-01-14 07:38:56 +00:00
/// Get a mutable entry that matches a key, if possible
Extract core stuff into own crates
This commit extracts five new crates:
- nu-source, which contains the core source-code handling logic in Nu,
including Text, Span, and also the pretty.rs-based debug logic
- nu-parser, which is the parser and expander logic
- nu-protocol, which is the bulk of the types and basic conveniences
used by plugins
- nu-errors, which contains ShellError, ParseError and error handling
conveniences
- nu-textview, which is the textview plugin extracted into a crate
One of the major consequences of this refactor is that it's no longer
possible to `impl X for Spanned<Y>` outside of the `nu-source` crate, so
a lot of types became more concrete (Value became a concrete type
instead of Spanned<Value>, for example).
This also turned a number of inherent methods in the main nu crate into
plain functions (impl Value {} became a bunch of functions in the
`value` namespace in `crate::data::value`).
2019-11-26 02:30:48 +00:00
pub fn get_mut_data_by_key ( & mut self , name : & str ) -> Option < & mut Value > {
match self
. entries
. iter_mut ( )
. find ( | ( desc_name , _ ) | * desc_name = = name )
{
Some ( ( _ , v ) ) = > Some ( v ) ,
None = > None ,
}
}
2020-01-14 07:38:56 +00:00
/// Insert a new key/value pair into the dictionary
Extract core stuff into own crates
This commit extracts five new crates:
- nu-source, which contains the core source-code handling logic in Nu,
including Text, Span, and also the pretty.rs-based debug logic
- nu-parser, which is the parser and expander logic
- nu-protocol, which is the bulk of the types and basic conveniences
used by plugins
- nu-errors, which contains ShellError, ParseError and error handling
conveniences
- nu-textview, which is the textview plugin extracted into a crate
One of the major consequences of this refactor is that it's no longer
possible to `impl X for Spanned<Y>` outside of the `nu-source` crate, so
a lot of types became more concrete (Value became a concrete type
instead of Spanned<Value>, for example).
This also turned a number of inherent methods in the main nu crate into
plain functions (impl Value {} became a bunch of functions in the
`value` namespace in `crate::data::value`).
2019-11-26 02:30:48 +00:00
pub fn insert_data_at_key ( & mut self , name : & str , value : Value ) {
self . entries . insert ( name . to_string ( ) , value ) ;
}
}
2019-12-04 19:52:31 +00:00
2020-01-14 07:38:56 +00:00
/// A helper to help create dictionaries for you. It has the ability to insert values into the dictionary while maintaining the tags that need to be applied to the individual members
2019-12-04 19:52:31 +00:00
#[ derive(Debug) ]
pub struct TaggedDictBuilder {
tag : Tag ,
dict : IndexMap < String , Value > ,
}
impl TaggedDictBuilder {
2020-01-14 07:38:56 +00:00
/// Create a new builder
2019-12-04 19:52:31 +00:00
pub fn new ( tag : impl Into < Tag > ) -> TaggedDictBuilder {
TaggedDictBuilder {
tag : tag . into ( ) ,
dict : IndexMap ::default ( ) ,
}
}
2020-01-14 07:38:56 +00:00
/// Build the contents of the builder into a Value
2019-12-04 19:52:31 +00:00
pub fn build ( tag : impl Into < Tag > , block : impl FnOnce ( & mut TaggedDictBuilder ) ) -> Value {
let mut builder = TaggedDictBuilder ::new ( tag ) ;
block ( & mut builder ) ;
builder . into_value ( )
}
2020-01-15 16:28:31 +00:00
/// Create a new builder with a pre-defined capacity
2019-12-04 19:52:31 +00:00
pub fn with_capacity ( tag : impl Into < Tag > , n : usize ) -> TaggedDictBuilder {
TaggedDictBuilder {
tag : tag . into ( ) ,
dict : IndexMap ::with_capacity ( n ) ,
}
}
2020-01-15 16:28:31 +00:00
/// Insert an untagged key/value pair into the dictionary, to later be tagged when built
2019-12-04 19:52:31 +00:00
pub fn insert_untagged ( & mut self , key : impl Into < String > , value : impl Into < UntaggedValue > ) {
self . dict
. insert ( key . into ( ) , value . into ( ) . into_value ( & self . tag ) ) ;
}
2020-01-15 16:28:31 +00:00
/// Insert a key/value pair into the dictionary
2019-12-04 19:52:31 +00:00
pub fn insert_value ( & mut self , key : impl Into < String > , value : impl Into < Value > ) {
self . dict . insert ( key . into ( ) , value . into ( ) ) ;
}
2020-01-15 16:28:31 +00:00
/// Convert the dictionary into a tagged Value using the original tag
2019-12-04 19:52:31 +00:00
pub fn into_value ( self ) -> Value {
let tag = self . tag . clone ( ) ;
self . into_untagged_value ( ) . into_value ( tag )
}
2020-01-15 16:28:31 +00:00
/// Convert the dictionary into an UntaggedValue
2019-12-04 19:52:31 +00:00
pub fn into_untagged_value ( self ) -> UntaggedValue {
UntaggedValue ::Row ( Dictionary { entries : self . dict } )
}
2020-01-15 16:28:31 +00:00
/// Returns true if the dictionary is empty, false otherwise
2019-12-04 19:52:31 +00:00
pub fn is_empty ( & self ) -> bool {
self . dict . is_empty ( )
}
}
impl From < TaggedDictBuilder > for Value {
2020-01-15 16:28:31 +00:00
/// Convert a builder into a tagged Value
2019-12-04 19:52:31 +00:00
fn from ( input : TaggedDictBuilder ) -> Value {
input . into_value ( )
}
}