pub struct ChainRegistry<P>(/* private fields */);Expand description
Registry of configured chain providers indexed by chain ID.
§Type Parameters
P- The chain provider type (e.g.,Eip155ChainProviderorSolanaChainProvider)
Implementations§
Source§impl<P> ChainRegistry<P>
impl<P> ChainRegistry<P>
Source§impl<P> ChainRegistry<P>
impl<P> ChainRegistry<P>
Sourcepub fn by_chain_id(&self, chain_id: &ChainId) -> Option<&P>
pub fn by_chain_id(&self, chain_id: &ChainId) -> Option<&P>
Looks up a provider by exact chain ID.
Returns None if no provider is configured for the given chain.
Sourcepub fn by_chain_id_pattern(&self, pattern: &ChainIdPattern) -> Vec<&P>
pub fn by_chain_id_pattern(&self, pattern: &ChainIdPattern) -> Vec<&P>
Looks up providers by chain ID pattern matching.
Returns all providers whose chain IDs match the given pattern. The pattern can be:
- Wildcard: Matches any chain within a namespace (e.g.,
eip155:*) - Exact: Matches a specific chain (e.g.,
eip155:8453) - Set: Matches any chain from a set of references (e.g.,
eip155:{1,8453,137})
Trait Implementations§
Auto Trait Implementations§
impl<P> Freeze for ChainRegistry<P>
impl<P> RefUnwindSafe for ChainRegistry<P>where
P: RefUnwindSafe,
impl<P> Send for ChainRegistry<P>where
P: Send,
impl<P> Sync for ChainRegistry<P>where
P: Sync,
impl<P> Unpin for ChainRegistry<P>where
P: Unpin,
impl<P> UnsafeUnpin for ChainRegistry<P>
impl<P> UnwindSafe for ChainRegistry<P>where
P: UnwindSafe,
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