@@ -24,6 +24,9 @@ use crate::miniscript::ScriptContext;
24
24
use crate :: prelude:: * ;
25
25
use crate :: { bitcoin, hash256, Error , Miniscript , MiniscriptKey , ToPublicKey } ;
26
26
27
+ #[ cfg( doc) ]
28
+ use crate :: Descriptor ;
29
+
27
30
fn return_none < T > ( _: usize ) -> Option < T > {
28
31
None
29
32
}
@@ -112,14 +115,14 @@ enum NonTerm {
112
115
// could be or_i or tern
113
116
EndIfElse ,
114
117
}
115
- /// All AST elements
116
- /// This variant is the inner Miniscript variant that allows the user to bypass
117
- /// some of the miniscript rules. You should *never* construct Terminal directly.
118
- /// This is only exposed to external user to allow matching on the [`crate::Miniscript`]
118
+ /// All AST elements.
119
+ ///
120
+ /// This variant is the inner Miniscript variant that allows the user to bypass some of the
121
+ /// miniscript rules. You should *never* construct `Terminal` directly. This is only exposed to
122
+ /// external users to allow matching on the [`Miniscript`].
119
123
///
120
- /// The average user should always use the [`crate::Descriptor`] APIs. Advanced users
121
- /// who want deal with Miniscript ASTs should use the [`crate::Miniscript`] APIs.
122
- #[ allow( broken_intra_doc_links) ]
124
+ /// The average user should always use the [`Descriptor`] APIs. Advanced users who want deal
125
+ /// with Miniscript ASTs should use the [`Miniscript`] APIs.
123
126
#[ derive( Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
124
127
pub enum Terminal < Pk : MiniscriptKey , Ctx : ScriptContext > {
125
128
/// `1`
@@ -160,38 +163,38 @@ pub enum Terminal<Pk: MiniscriptKey, Ctx: ScriptContext> {
160
163
Check ( Arc < Miniscript < Pk , Ctx > > ) ,
161
164
/// `DUP IF [V] ENDIF`
162
165
DupIf ( Arc < Miniscript < Pk , Ctx > > ) ,
163
- /// [T] VERIFY
166
+ /// ` [T] VERIFY`
164
167
Verify ( Arc < Miniscript < Pk , Ctx > > ) ,
165
- /// SIZE 0NOTEQUAL IF [Fn] ENDIF
168
+ /// ` SIZE 0NOTEQUAL IF [Fn] ENDIF`
166
169
NonZero ( Arc < Miniscript < Pk , Ctx > > ) ,
167
- /// [X] 0NOTEQUAL
170
+ /// ` [X] 0NOTEQUAL`
168
171
ZeroNotEqual ( Arc < Miniscript < Pk , Ctx > > ) ,
169
172
// Conjunctions
170
- /// [V] [T]/[V]/[F]/[Kt]
173
+ /// ` [V] [T]/[V]/[F]/[Kt]`
171
174
AndV ( Arc < Miniscript < Pk , Ctx > > , Arc < Miniscript < Pk , Ctx > > ) ,
172
- /// [E] [W] BOOLAND
175
+ /// ` [E] [W] BOOLAND`
173
176
AndB ( Arc < Miniscript < Pk , Ctx > > , Arc < Miniscript < Pk , Ctx > > ) ,
174
- /// [various] NOTIF [various] ELSE [various] ENDIF
177
+ /// ` [various] NOTIF [various] ELSE [various] ENDIF`
175
178
AndOr (
176
179
Arc < Miniscript < Pk , Ctx > > ,
177
180
Arc < Miniscript < Pk , Ctx > > ,
178
181
Arc < Miniscript < Pk , Ctx > > ,
179
182
) ,
180
183
// Disjunctions
181
- /// [E] [W] BOOLOR
184
+ /// ` [E] [W] BOOLOR`
182
185
OrB ( Arc < Miniscript < Pk , Ctx > > , Arc < Miniscript < Pk , Ctx > > ) ,
183
- /// [E] IFDUP NOTIF [T]/[E] ENDIF
186
+ /// ` [E] IFDUP NOTIF [T]/[E] ENDIF`
184
187
OrD ( Arc < Miniscript < Pk , Ctx > > , Arc < Miniscript < Pk , Ctx > > ) ,
185
- /// [E] NOTIF [V] ENDIF
188
+ /// ` [E] NOTIF [V] ENDIF`
186
189
OrC ( Arc < Miniscript < Pk , Ctx > > , Arc < Miniscript < Pk , Ctx > > ) ,
187
- /// IF [various] ELSE [various] ENDIF
190
+ /// ` IF [various] ELSE [various] ENDIF`
188
191
OrI ( Arc < Miniscript < Pk , Ctx > > , Arc < Miniscript < Pk , Ctx > > ) ,
189
192
// Thresholds
190
- /// [E] ([W] ADD)* k EQUAL
193
+ /// ` [E] ([W] ADD)* k EQUAL`
191
194
Thresh ( usize , Vec < Arc < Miniscript < Pk , Ctx > > > ) ,
192
- /// k (<key>)* n CHECKMULTISIG
195
+ /// ` k (<key>)* n CHECKMULTISIG`
193
196
Multi ( usize , Vec < Pk > ) ,
194
- /// <key> CHECKSIG (<key> CHECKSIGADD)*(n-1) k NUMEQUAL
197
+ /// ` <key> CHECKSIG (<key> CHECKSIGADD)*(n-1) k NUMEQUAL`
195
198
MultiA ( usize , Vec < Pk > ) ,
196
199
}
197
200
0 commit comments