pub struct SerdeValueMapAggregator<'a, 'a2, 't, 'de, 's, 's1, 's2, E>{
    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>

source

pub fn new( context: &'a SerializationContext<'s, 'a2, E>, value_context: &'a ValueContext ) -> SerdeValueMapAggregator<'a, 'a2, 't, 'de, 's, 's1, 's2, E>

source

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>

source

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

source

pub fn child_details_are_needed(&self) -> bool

source

pub fn add_initial_details( &mut self, value_kind: ValueKind<<E as CustomExtension>::CustomValueKind>, type_name: Option<&'a str> )

source

pub fn add_initial_details_with_custom_value_kind_name( &mut self, value_kind_name: &'a str, type_name: Option<&'a str> )

source

pub fn add_element_details( &mut self, element_value_kind: ValueKind<<E as CustomExtension>::CustomValueKind>, element_type_name: Option<&'a str> )

source

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<'_> )

source

pub fn add_enum_variant_details( &mut self, variant_id: u8, variant_name: Option<&'a str> )

source

pub fn add_field( &mut self, field_name: &'static str, value: SerializableType<'a, 't, 'de, 's1, 's2, E> )

source

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>

§

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§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<U> As for U

§

fn as_<T>(self) -> T
where 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 more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V