pub enum LookupResult {
OutputList(Vec<UTXOReference>),
Answer(LookupAnswer),
}Expand description
What a LookupService::lookup call returns to the Engine.
Two shapes:
-
OutputList(Vec<UTXOReference>)— the common case. The service yields outpoints; the Engine hydrates each with the BEEF from storage and assembles aLookupAnswer::OutputList. This is the cheap path: the service doesn’t need access to BEEF storage, and the Engine can apply uniform history-selector hydration / sort / pagination on top. -
Answer(LookupAnswer)— the escape hatch. Services that returnFreeform(aggregate stats like popular-tag counts) orFormula(cross-service lookup chains) emit the full answer themselves; the Engine passes it through verbatim. This avoids theVec<UTXOReference>→OutputListshape mismatch that previously forced services to do hex tricks or hold back functionality.
Migration note: prior to this enum, the trait method returned
Vec<UTXOReference> and the Engine always wrapped it in
LookupAnswer::OutputList. Existing impls migrate mechanically by
wrapping their result in LookupResult::OutputList(refs). New impls
that need freeform or formula answers return LookupResult::Answer(...).
Variants§
OutputList(Vec<UTXOReference>)
Outpoints to hydrate. The Engine will load BEEF per reference
(and optional history-selector ancestry) and assemble
LookupAnswer::OutputList.
Answer(LookupAnswer)
Pre-formed LookupAnswer — Engine passes it through. Use for
Freeform (aggregate stats) and Formula (formula chains).
Implementations§
Source§impl LookupResult
impl LookupResult
Sourcepub fn outputs(refs: Vec<UTXOReference>) -> Self
pub fn outputs(refs: Vec<UTXOReference>) -> Self
Convenience: wrap a Vec<UTXOReference> (the common path).
Sourcepub fn answer(answer: LookupAnswer) -> Self
pub fn answer(answer: LookupAnswer) -> Self
Convenience: wrap a LookupAnswer (freeform / formula path).
Sourcepub fn as_outputs(&self) -> Option<&[UTXOReference]>
pub fn as_outputs(&self) -> Option<&[UTXOReference]>
Borrow the OutputList variant, or None if Answer. Primarily
used by tests that want to assert on the reference list directly.
Sourcepub fn into_outputs(self) -> Option<Vec<UTXOReference>>
pub fn into_outputs(self) -> Option<Vec<UTXOReference>>
Consume self and extract Vec<UTXOReference>, or None if
Answer. Primarily used by tests + the small set of callers that
want references without going through Engine BEEF hydration.