pub struct SchemeBlueprints<P>(/* private fields */);Expand description
Registry of scheme blueprints (factories).
Blueprints are used to create scheme handlers for specific chain providers. Register blueprints at startup, then use them to build handlers.
§Type Parameters
P- The chain provider type that blueprints can extract from using [FromChainProvider]
Implementations§
Source§impl<P> SchemeBlueprints<P>
impl<P> SchemeBlueprints<P>
Sourcepub fn and_register<B: X402SchemeBlueprint<P> + 'static>(
self,
blueprint: B,
) -> Self
pub fn and_register<B: X402SchemeBlueprint<P> + 'static>( self, blueprint: B, ) -> Self
Registers a blueprint and returns self for chaining.
Sourcepub fn register<B: X402SchemeBlueprint<P> + 'static>(&mut self, blueprint: B)
pub fn register<B: X402SchemeBlueprint<P> + 'static>(&mut self, blueprint: B)
Registers a scheme blueprint.
Sourcepub fn get(&self, id: &str) -> Option<&dyn X402SchemeBlueprint<P>>
pub fn get(&self, id: &str) -> Option<&dyn X402SchemeBlueprint<P>>
Gets a blueprint by its ID.
Trait Implementations§
Source§impl<P> Debug for SchemeBlueprints<P>
impl<P> Debug for SchemeBlueprints<P>
Source§impl<P: Default> Default for SchemeBlueprints<P>
impl<P: Default> Default for SchemeBlueprints<P>
Source§fn default() -> SchemeBlueprints<P>
fn default() -> SchemeBlueprints<P>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<P> Freeze for SchemeBlueprints<P>
impl<P> !RefUnwindSafe for SchemeBlueprints<P>
impl<P> !Send for SchemeBlueprints<P>
impl<P> !Sync for SchemeBlueprints<P>
impl<P> Unpin for SchemeBlueprints<P>where
P: Unpin,
impl<P> !UnwindSafe for SchemeBlueprints<P>
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