pub struct ExtensionRegistry { /* private fields */ }Expand description
Ordered collection of extensions attached to a facilitator or paygate.
Stored as Vec<Arc<dyn DynExtension>> so extensions can be shared across
clones. Lookups by ID go through a parallel HashMap.
Implementations§
Source§impl ExtensionRegistry
impl ExtensionRegistry
Sourcepub fn register<E: Extension + 'static>(&mut self, extension: E)
pub fn register<E: Extension + 'static>(&mut self, extension: E)
Registers an extension. Later registrations of the same id overwrite earlier ones (idempotent insert).
Sourcepub fn get(&self, id: &str) -> Option<&dyn DynExtension>
pub fn get(&self, id: &str) -> Option<&dyn DynExtension>
Looks up an extension by its stable id.
Sourcepub fn iter(&self) -> impl Iterator<Item = &dyn DynExtension>
pub fn iter(&self) -> impl Iterator<Item = &dyn DynExtension>
Iterates over all registered extensions in registration order.
Sourcepub fn advertise(&self, ctx: &AdvertiseContext<'_>) -> Extensions
pub fn advertise(&self, ctx: &AdvertiseContext<'_>) -> Extensions
Builds a wire-level Extensions block for seller advertising.
Sourcepub async fn collect_verify(&self, ctx: &VerifyContext<'_>) -> Extensions
pub async fn collect_verify(&self, ctx: &VerifyContext<'_>) -> Extensions
Builds a wire-level Extensions block by collecting each extension’s
on_verify return value.
Sourcepub async fn collect_settle(&self, ctx: &SettleContext<'_>) -> Extensions
pub async fn collect_settle(&self, ctx: &SettleContext<'_>) -> Extensions
Builds a wire-level Extensions block by collecting each extension’s
on_settle return value.
Trait Implementations§
Source§impl Clone for ExtensionRegistry
impl Clone for ExtensionRegistry
Source§fn clone(&self) -> ExtensionRegistry
fn clone(&self) -> ExtensionRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExtensionRegistry
impl Debug for ExtensionRegistry
Source§impl Default for ExtensionRegistry
impl Default for ExtensionRegistry
Source§fn default() -> ExtensionRegistry
fn default() -> ExtensionRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for ExtensionRegistry
impl !UnwindSafe for ExtensionRegistry
impl Freeze for ExtensionRegistry
impl Send for ExtensionRegistry
impl Sync for ExtensionRegistry
impl Unpin for ExtensionRegistry
impl UnsafeUnpin for ExtensionRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more