Trait FromTree

Source
pub trait FromTree: Sized {
    // Required method
    fn from_tree(top: &Tree<'_>) -> Result<Self, Error>;
}
Expand description

A trait for extracting a structure from a Tree representation in token form

Required Methods§

Source

fn from_tree(top: &Tree<'_>) -> Result<Self, Error>

Extract a structure from Tree representation

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<Pk, Ctx> FromTree for Arc<Terminal<Pk, Ctx>>
where Pk: MiniscriptKey + FromStr, Pk::Hash: FromStr, Ctx: ScriptContext, <Pk as FromStr>::Err: ToString, <<Pk as MiniscriptKey>::Hash as FromStr>::Err: ToString,

Source§

fn from_tree(top: &Tree<'_>) -> Result<Arc<Terminal<Pk, Ctx>>, Error>

Source§

impl<Pk, Ctx> FromTree for Arc<Miniscript<Pk, Ctx>>
where Pk: MiniscriptKey + FromStr, Pk::Hash: FromStr, Ctx: ScriptContext, <Pk as FromStr>::Err: ToString, <<Pk as MiniscriptKey>::Hash as FromStr>::Err: ToString,

Source§

fn from_tree(top: &Tree<'_>) -> Result<Arc<Miniscript<Pk, Ctx>>, Error>

Implementors§

Source§

impl<Pk> FromTree for Descriptor<Pk>
where Pk: MiniscriptKey + FromStr, Pk::Hash: FromStr, <Pk as FromStr>::Err: ToString, <<Pk as MiniscriptKey>::Hash as FromStr>::Err: ToString,

Source§

impl<Pk> FromTree for PreTaprootDescriptor<Pk>
where Pk: MiniscriptKey + FromStr, Pk::Hash: FromStr, <Pk as FromStr>::Err: ToString, <<Pk as MiniscriptKey>::Hash as FromStr>::Err: ToString,

Source§

impl<Pk> FromTree for sapio_miniscript::policy::concrete::Policy<Pk>
where Pk: MiniscriptKey + FromStr, Pk::Hash: FromStr, <Pk as FromStr>::Err: ToString,

Source§

impl<Pk> FromTree for sapio_miniscript::policy::semantic::Policy<Pk>
where Pk: MiniscriptKey + FromStr, Pk::Hash: FromStr, <Pk as FromStr>::Err: ToString, <<Pk as MiniscriptKey>::Hash as FromStr>::Err: ToString,

Source§

impl<Pk> FromTree for Bare<Pk>
where Pk: MiniscriptKey + FromStr, Pk::Hash: FromStr, <Pk as FromStr>::Err: ToString, <<Pk as MiniscriptKey>::Hash as FromStr>::Err: ToString,

Source§

impl<Pk> FromTree for Pkh<Pk>
where Pk: MiniscriptKey + FromStr, Pk::Hash: FromStr, <Pk as FromStr>::Err: ToString, <<Pk as MiniscriptKey>::Hash as FromStr>::Err: ToString,

Source§

impl<Pk> FromTree for Sh<Pk>
where Pk: MiniscriptKey + FromStr, Pk::Hash: FromStr, <Pk as FromStr>::Err: ToString, <<Pk as MiniscriptKey>::Hash as FromStr>::Err: ToString,

Source§

impl<Pk> FromTree for Tr<Pk>
where Pk: MiniscriptKey + FromStr, Pk::Hash: FromStr, <Pk as FromStr>::Err: ToString, <<Pk as MiniscriptKey>::Hash as FromStr>::Err: ToString,

Source§

impl<Pk> FromTree for Wpkh<Pk>
where Pk: MiniscriptKey + FromStr, Pk::Hash: FromStr, <Pk as FromStr>::Err: ToString, <<Pk as MiniscriptKey>::Hash as FromStr>::Err: ToString,

Source§

impl<Pk> FromTree for Wsh<Pk>
where Pk: MiniscriptKey + FromStr, Pk::Hash: FromStr, <Pk as FromStr>::Err: ToString, <<Pk as MiniscriptKey>::Hash as FromStr>::Err: ToString,

Source§

impl<Pk, Ctx> FromTree for Terminal<Pk, Ctx>
where Pk: MiniscriptKey + FromStr, Pk::Hash: FromStr, Ctx: ScriptContext, <Pk as FromStr>::Err: ToString, <<Pk as MiniscriptKey>::Hash as FromStr>::Err: ToString,

Source§

impl<Pk, Ctx> FromTree for Miniscript<Pk, Ctx>
where Pk: MiniscriptKey + FromStr, Pk::Hash: FromStr, Ctx: ScriptContext, <Pk as FromStr>::Err: ToString, <<Pk as MiniscriptKey>::Hash as FromStr>::Err: ToString,