Struct scrypto::prelude::radix_engine_common::prelude::representations::SerdeValueMapAggregator
source · pub struct SerdeValueMapAggregator<'a, 'a2, 't, 'de, 's, 's1, 's2, E>where
E: SerializableCustomExtension,{
context: &'a SerializationContext<'s, 'a2, E>,
opt_into_kind_tag_in_simple_mode: bool,
value_context: &'a ValueContext,
fields: Vec<(&'a str, SerializableType<'a, 't, 'de, 's1, 's2, E>)>,
}
Fields§
§context: &'a SerializationContext<'s, 'a2, E>
§opt_into_kind_tag_in_simple_mode: bool
§value_context: &'a ValueContext
§fields: Vec<(&'a str, SerializableType<'a, 't, 'de, 's1, 's2, E>)>
Implementations§
source§impl<'a, 'a2, 't, 'de, 's, 's1, 's2, E> SerdeValueMapAggregator<'a, 'a2, 't, 'de, 's, 's1, 's2, E>where
E: SerializableCustomExtension,
impl<'a, 'a2, 't, 'de, 's, 's1, 's2, E> SerdeValueMapAggregator<'a, 'a2, 't, 'de, 's, 's1, 's2, E>where
E: SerializableCustomExtension,
pub fn new( context: &'a SerializationContext<'s, 'a2, E>, value_context: &'a ValueContext ) -> SerdeValueMapAggregator<'a, 'a2, 't, 'de, 's, 's1, 's2, E>
pub fn new_with_kind_tag( context: &'a SerializationContext<'s, 'a2, E>, value_context: &'a ValueContext ) -> SerdeValueMapAggregator<'a, 'a2, 't, 'de, 's, 's1, 's2, E>
sourcepub fn should_embed_value_in_contextual_json_map(&self) -> bool
pub fn should_embed_value_in_contextual_json_map(&self) -> bool
SBOR values can either be represented just as a JSON value, or in a contextual JSON object. This contextual object allows for adding extra information (eg type names, kind tags, etc). As a general rule, Natural uses mostly JSON values, and Programmatic/Model use mostly contextual objects.
This method returns whether a wrapping object is needed.
Note that some types have to be embedded in a wrapper object, so
pub fn child_details_are_needed(&self) -> bool
pub fn add_initial_details( &mut self, value_kind: ValueKind<<E as CustomExtension>::CustomValueKind>, type_name: Option<&'a str> )
pub fn add_initial_details_with_custom_value_kind_name( &mut self, value_kind_name: &'a str, type_name: Option<&'a str> )
pub fn add_element_details( &mut self, element_value_kind: ValueKind<<E as CustomExtension>::CustomValueKind>, element_type_name: Option<&'a str> )
pub fn add_map_child_details( &mut self, key_value_kind: ValueKind<<E as CustomExtension>::CustomValueKind>, value_value_kind: ValueKind<<E as CustomExtension>::CustomValueKind>, map_data: &'a MapData<'_> )
pub fn add_enum_variant_details( &mut self, variant_id: u8, variant_name: Option<&'a str> )
pub fn add_field( &mut self, field_name: &'static str, value: SerializableType<'a, 't, 'de, 's1, 's2, E> )
pub fn into_map<S>(
self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Auto Trait Implementations§
impl<'a, 'a2, 't, 'de, 's, 's1, 's2, E> !RefUnwindSafe for SerdeValueMapAggregator<'a, 'a2, 't, 'de, 's, 's1, 's2, E>
impl<'a, 'a2, 't, 'de, 's, 's1, 's2, E> Send for SerdeValueMapAggregator<'a, 'a2, 't, 'de, 's, 's1, 's2, E>where
<E as FormattableCustomExtension>::CustomDisplayContext<'a2>: Sync,
<<E as CustomExtension>::CustomSchema as CustomSchema>::CustomTypeKind<LocalTypeId>: Sync,
<<E as CustomExtension>::CustomSchema as CustomSchema>::CustomTypeValidation: Sync,
<E as CustomExtension>::CustomValueKind: Send,
impl<'a, 'a2, 't, 'de, 's, 's1, 's2, E> !Sync for SerdeValueMapAggregator<'a, 'a2, 't, 'de, 's, 's1, 's2, E>
impl<'a, 'a2, 't, 'de, 's, 's1, 's2, E> Unpin for SerdeValueMapAggregator<'a, 'a2, 't, 'de, 's, 's1, 's2, E>
impl<'a, 'a2, 't, 'de, 's, 's1, 's2, E> !UnwindSafe for SerdeValueMapAggregator<'a, 'a2, 't, 'de, 's, 's1, 's2, E>
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
Casts
self
to type T
. The semantics of numeric casting with the as
operator are followed, so <T as As>::as_::<U>
can be used in the same way as T as U
for numeric conversions. Read moresource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more