pub struct TransactionTemplateSet(pub BTreeMap<String, TransactionTemplate>);Expand description
Data structure denoting a set of templates on a type, indexed by (string) name.
Tuple Fields§
§0: BTreeMap<String, TransactionTemplate>Implementations§
Source§impl TransactionTemplateSet
impl TransactionTemplateSet
Sourcepub fn fill_links(
field_templates: Vec<(String, TransactionTemplate)>,
child_links: Vec<Link>,
) -> Self
pub fn fill_links( field_templates: Vec<(String, TransactionTemplate)>, child_links: Vec<Link>, ) -> Self
Replace placeholder links in templates with actual typelinks from the schema (provided by
the type’s child_links).
Template placeholders must be IndexedPlaceholders because a template does not necessarily
include placeholders for every field - some fields may be provided with pre-encoded default
values and thus need to be skipped. The index allows looking up the correct type in the
child_links vector.
Sourcepub fn concatenate_template_sets(
template_sets: Vec<AttributeAndChildTemplateSet>,
type_name_for_diagnostics: &'static str,
) -> Self
pub fn concatenate_template_sets( template_sets: Vec<AttributeAndChildTemplateSet>, type_name_for_diagnostics: &'static str, ) -> Self
Input: a vector of template sets, normally one for each field of a type. Outputs: a merged template set. This means:
- Every individual template is concatenated from each field portion of it, across the set of templates.
- The entire set is enforced to be present on every field, so no fields are skipped.
The exception to the 2nd rule above is for templates only present in the set through field types (i.e. subtype templates). See the documentation of AttributeAndChildTemplateSet for a full explanation.
Sourcepub fn filter_enum_variant_templates(
self,
filter: Vec<String>,
inherit_all: bool,
variant_name_for_diagnostics: &'static str,
) -> Self
pub fn filter_enum_variant_templates( self, filter: Vec<String>, inherit_all: bool, variant_name_for_diagnostics: &'static str, ) -> Self
Explicitly filter which templates will be part of a given enum variant. Only templates whose name is in the list will be set on the variant. Additionally, any names in the list NOT present in the templates will cause an error.
Optionally, an override can be set to inherit all templates from the variant (primarily
intended for use on the RuntimeCall, to inherit all templates from every module’s
CallMessage). In this case, the filter list is only used for error checking, to
explicitly enforce that all templates named in it MUST be present.
pub fn merge_enum_template_sets( template_sets: Vec<TransactionTemplateSet>, type_name_for_diagnostics: &'static str, ) -> Self
Trait Implementations§
Source§impl BorshDeserialize for TransactionTemplateSet
impl BorshDeserialize for TransactionTemplateSet
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl Clone for TransactionTemplateSet
impl Clone for TransactionTemplateSet
Source§fn clone(&self) -> TransactionTemplateSet
fn clone(&self) -> TransactionTemplateSet
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more