Struct Codegen

Source
pub struct Codegen<'a> { /* private fields */ }

Implementations§

Source§

impl Codegen<'_>

Source

pub fn new() -> Codegen<'static>

Source

pub fn get_blueprint_from_json(&self, json: String) -> Blueprint

Parses a JSON string into a Blueprint.

§Arguments
  • json - The JSON data from a plutus.json file
§Returns

A Blueprint instance.

Source

pub fn get_blueprint_from_path(&self, path: String) -> Blueprint

Reads a JSON file from a specified path and parses it into a Blueprint.

§Arguments
  • path - The plutus.json file path in the filesystem
§Returns

A Blueprint instance.

Source

pub fn get_schemas_from_blueprint(&self, blueprint: Blueprint) -> Vec<Schema>

Obtains the list of schemas from a given Blueprint.

§Arguments
  • blueprint - A Blueprint from which to obtain the schemas.
§Returns

A vector of Schema from the blueprint.

Source

pub fn get_validators_from_blueprint( &self, blueprint: Blueprint, ) -> Vec<Validator>

Obtains the list of validators from a given Blueprint.

§Arguments
  • blueprint - A Blueprint from which to obtain the validators.
§Returns

A vector of Validator from the blueprint.

Source

pub fn get_template_from_blueprint( &self, blueprint: Blueprint, template: Template, ) -> String

Generates the boilerplate code for a given Blueprint for the given Template.

§Arguments
  • blueprint - A Blueprint from which to create the boilerplate code.
  • template - A Template from which to create the boilerplate code.
§Returns

A string containing the boilerplate code.

Auto Trait Implementations§

§

impl<'a> Freeze for Codegen<'a>

§

impl<'a> !RefUnwindSafe for Codegen<'a>

§

impl<'a> Send for Codegen<'a>

§

impl<'a> Sync for Codegen<'a>

§

impl<'a> Unpin for Codegen<'a>

§

impl<'a> !UnwindSafe for Codegen<'a>

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