Skip to main content

TransactionTemplateSet

Struct TransactionTemplateSet 

Source
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

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.

Source

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.

Source

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.

Source

pub fn merge_enum_template_sets( template_sets: Vec<TransactionTemplateSet>, type_name_for_diagnostics: &'static str, ) -> Self

Trait Implementations§

Source§

impl BorshDeserialize for TransactionTemplateSet

Source§

fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>

Source§

fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>

Deserializes this instance from a given slice of bytes. Updates the buffer to point at the remaining bytes.
Source§

fn try_from_slice(v: &[u8]) -> Result<Self, Error>

Deserialize this instance from a slice of bytes.
Source§

fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>
where R: Read,

Source§

impl BorshSerialize for TransactionTemplateSet

Source§

fn serialize<__W: Write>(&self, writer: &mut __W) -> Result<(), Error>

Source§

impl Clone for TransactionTemplateSet

Source§

fn clone(&self) -> TransactionTemplateSet

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TransactionTemplateSet

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TransactionTemplateSet

Source§

fn default() -> TransactionTemplateSet

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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
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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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>,

Source§

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.