pub struct BazaarExtension {
pub catalog: Option<CompactString>,
pub categories: Vec<CompactString>,
pub registered: bool,
}Available on crate feature
ext-bazaar only.Expand description
Server-side implementation of the bazaar discovery extension.
Fields§
§catalog: Option<CompactString>Optional catalog URL pointing at a machine-readable resource index.
categories: Vec<CompactString>Optional list of free-form category labels.
registered: boolWhether this resource has been registered with the upstream discovery service.
Implementations§
Source§impl BazaarExtension
impl BazaarExtension
Sourcepub fn with_catalog(self, catalog: impl Into<CompactString>) -> Self
pub fn with_catalog(self, catalog: impl Into<CompactString>) -> Self
Builder: attaches a catalog URL.
Sourcepub fn with_category(self, category: impl Into<CompactString>) -> Self
pub fn with_category(self, category: impl Into<CompactString>) -> Self
Builder: adds a single category label.
Sourcepub const fn registered(self) -> Self
pub const fn registered(self) -> Self
Builder: marks the resource as registered.
Trait Implementations§
Source§impl Clone for BazaarExtension
impl Clone for BazaarExtension
Source§fn clone(&self) -> BazaarExtension
fn clone(&self) -> BazaarExtension
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 BazaarExtension
impl Debug for BazaarExtension
Source§impl Default for BazaarExtension
impl Default for BazaarExtension
Source§fn default() -> BazaarExtension
fn default() -> BazaarExtension
Returns the “default value” for a type. Read more
Source§impl Extension for BazaarExtension
impl Extension for BazaarExtension
Source§fn id(&self) -> &'static str
fn id(&self) -> &'static str
Stable extension identifier (e.g.
"bazaar", "payment-identifier").Source§fn advertise(&self, _ctx: &AdvertiseContext<'_>) -> Option<ExtensionEntry>
fn advertise(&self, _ctx: &AdvertiseContext<'_>) -> Option<ExtensionEntry>
Called when the seller assembles a 402 response. Return an entry to
attach to
PaymentRequired.extensions (or the per-requirement
extensions, if AdvertiseContext::requirement is Some).Source§fn on_verify<'a>(
&'a self,
_ctx: &'a VerifyContext<'a>,
) -> impl Future<Output = Option<ExtensionEntry>> + Send + 'a
fn on_verify<'a>( &'a self, _ctx: &'a VerifyContext<'a>, ) -> impl Future<Output = Option<ExtensionEntry>> + Send + 'a
Called by the facilitator after
verify. Return an entry to attach
to the outgoing VerifyResponse.extensions map.Source§fn on_settle<'a>(
&'a self,
_ctx: &'a SettleContext<'a>,
) -> impl Future<Output = Option<ExtensionEntry>> + Send + 'a
fn on_settle<'a>( &'a self, _ctx: &'a SettleContext<'a>, ) -> impl Future<Output = Option<ExtensionEntry>> + Send + 'a
Called by the facilitator after
settle. Return an entry to attach
to the outgoing SettleResponse.extensions map.Auto Trait Implementations§
impl Freeze for BazaarExtension
impl RefUnwindSafe for BazaarExtension
impl Send for BazaarExtension
impl Sync for BazaarExtension
impl Unpin for BazaarExtension
impl UnsafeUnpin for BazaarExtension
impl UnwindSafe for BazaarExtension
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DynExtension for T
impl<T> DynExtension for T
Source§fn advertise(&self, ctx: &AdvertiseContext<'_>) -> Option<ExtensionEntry>
fn advertise(&self, ctx: &AdvertiseContext<'_>) -> Option<ExtensionEntry>
See
Extension::advertise.Source§fn on_verify<'a>(
&'a self,
ctx: &'a VerifyContext<'a>,
) -> Pin<Box<dyn Future<Output = Option<ExtensionEntry>> + Send + 'a>>
fn on_verify<'a>( &'a self, ctx: &'a VerifyContext<'a>, ) -> Pin<Box<dyn Future<Output = Option<ExtensionEntry>> + Send + 'a>>
See
Extension::on_verify.Source§fn on_settle<'a>(
&'a self,
ctx: &'a SettleContext<'a>,
) -> Pin<Box<dyn Future<Output = Option<ExtensionEntry>> + Send + 'a>>
fn on_settle<'a>( &'a self, ctx: &'a SettleContext<'a>, ) -> Pin<Box<dyn Future<Output = Option<ExtensionEntry>> + Send + 'a>>
See
Extension::on_settle.