Skip to main content

FromExtensions

Derive Macro FromExtensions 

#[derive(FromExtensions)]
Expand description

Derive a from_extensions constructor that gathers extension pieces from a rama_core::extensions::Extensions store in a single pass.

Fields must be Option<&'a T> (borrowed) or Option<Arc<T>> (owned Arc clone), the two may be mixed. A borrowed field requires the struct to carry the matching lifetime (struct View<'a>) and an all-Arc struct needs no lifetime. Generates fn from_extensions(ext: &Extensions) -> Self, where each field uses the same lookup as Extensions::get_ref but the store is traversed only once.