From 61a01ea957c7b7a842f8ad768bf0a43fabed6fb9 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Sat, 13 Feb 2021 23:01:26 +0800 Subject: [PATCH] Add comments to Union. --- src/dynamic.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/dynamic.rs b/src/dynamic.rs index c5a2743b..afd1e099 100644 --- a/src/dynamic.rs +++ b/src/dynamic.rs @@ -152,25 +152,38 @@ pub struct Dynamic(pub(crate) Union); /// /// Most variants are boxed to reduce the size. pub enum Union { + /// The Unit value - (). Unit((), AccessMode), + /// A boolean value. Bool(bool, AccessMode), + /// An [`ImmutableString`] value. Str(ImmutableString, AccessMode), + /// A character value. Char(char, AccessMode), + /// An integer value. Int(INT, AccessMode), + /// A floating-point value. #[cfg(not(feature = "no_float"))] Float(FloatWrapper, AccessMode), + /// A fixed-precision decimal value. #[cfg(feature = "decimal")] Decimal(Box, AccessMode), + /// An array value. #[cfg(not(feature = "no_index"))] Array(Box, AccessMode), + /// An object map value. #[cfg(not(feature = "no_object"))] Map(Box, AccessMode), + /// A function pointer. FnPtr(Box, AccessMode), + /// A timestamp value. #[cfg(not(feature = "no_std"))] TimeStamp(Box, AccessMode), + /// Any type as a trait object. Variant(Box>, AccessMode), + /// A _shared_ value of any type. #[cfg(not(feature = "no_closure"))] Shared(crate::Shared>, AccessMode), }