Trait Apply

Source
pub trait Apply: Sized + Debug {
    // Required methods
    fn apply_args(
        self,
        args: &BTreeMap<String, ArgValue>,
    ) -> Result<Self, Error>;
    fn apply_inputs(
        self,
        args: &BTreeMap<String, HashSet<Utxo>>,
    ) -> Result<Self, Error>;
    fn apply_fees(self, fees: u64) -> Result<Self, Error>;
    fn is_constant(&self) -> bool;
    fn params(&self) -> BTreeMap<String, Type>;
    fn queries(&self) -> BTreeMap<String, InputQuery>;
    fn reduce_self(self) -> Result<Self, Error>;
    fn reduce_nested(self) -> Result<Self, Error>;

    // Provided method
    fn reduce(self) -> Result<Self, Error> { ... }
}

Required Methods§

Source

fn apply_args(self, args: &BTreeMap<String, ArgValue>) -> Result<Self, Error>

Source

fn apply_inputs( self, args: &BTreeMap<String, HashSet<Utxo>>, ) -> Result<Self, Error>

Source

fn apply_fees(self, fees: u64) -> Result<Self, Error>

Source

fn is_constant(&self) -> bool

Source

fn params(&self) -> BTreeMap<String, Type>

Source

fn queries(&self) -> BTreeMap<String, InputQuery>

Source

fn reduce_self(self) -> Result<Self, Error>

Source

fn reduce_nested(self) -> Result<Self, Error>

Provided Methods§

Source

fn reduce(self) -> Result<Self, Error>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> Apply for Option<T>
where T: Apply,

Source§

impl<T> Apply for Box<T>
where T: Apply,

Source§

impl<T> Apply for Vec<T>
where T: Apply,

Source§

impl<T> Apply for HashMap<String, T>
where T: Apply,

Implementors§