#[non_exhaustive]#[repr(u32)]pub enum DomainId {
Show 21 variants
Ethereum = 0,
Avalanche = 1,
Optimism = 2,
Arbitrum = 3,
Solana = 5,
Base = 6,
Polygon = 7,
Unichain = 10,
Linea = 11,
Codex = 12,
Sonic = 13,
WorldChain = 14,
Monad = 15,
Sei = 16,
BnbSmartChain = 17,
Xdc = 18,
HyperEvm = 19,
Ink = 21,
Plume = 22,
StarknetTestnet = 25,
ArcTestnet = 26,
}Expand description
CCTP domain identifier for blockchain networks
Each blockchain network supported by Circle’s CCTP has a unique domain ID. This enum provides type-safe representation of these identifiers.
§CCTP Version Support
- Domains 0-10: Supported in CCTP v1 and v2
- Domains 11+: Only supported in CCTP v2
§Example
use cctp_rs::DomainId;
let ethereum_domain = DomainId::Ethereum;
let domain_value: u32 = ethereum_domain.into();
assert_eq!(domain_value, 0);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Ethereum = 0
Ethereum mainnet and Sepolia testnet (Domain ID: 0)
Avalanche = 1
Avalanche C-Chain (Domain ID: 1)
Optimism = 2
Optimism (Domain ID: 2)
Arbitrum = 3
Arbitrum One and Arbitrum Sepolia (Domain ID: 3)
Solana = 5
Solana (Domain ID: 5) - Non-EVM chain, v2 only
Base = 6
Base and Base Sepolia (Domain ID: 6)
Polygon = 7
Polygon PoS (Domain ID: 7)
Unichain = 10
Unichain (Domain ID: 10)
Linea = 11
Linea (Domain ID: 11) - v2 only
Codex = 12
Codex (Domain ID: 12) - v2 only
Sonic = 13
Sonic (Domain ID: 13) - v2 only
WorldChain = 14
World Chain (Domain ID: 14) - v2 only
Monad = 15
Monad (Domain ID: 15) - v2 only
Sei = 16
Sei (Domain ID: 16) - v2 only
BnbSmartChain = 17
BNB Smart Chain (Domain ID: 17) - v2 only
Xdc = 18
XDC Network (Domain ID: 18) - v2 only
HyperEvm = 19
HyperEVM (Domain ID: 19) - v2 only
Ink = 21
Ink (Domain ID: 21) - v2 only
Plume = 22
Plume (Domain ID: 22) - v2 only
StarknetTestnet = 25
Starknet Testnet (Domain ID: 25) - Non-EVM chain, v2 only
ArcTestnet = 26
Arc Testnet (Domain ID: 26) - v2 only
Implementations§
Source§impl DomainId
impl DomainId
Sourcepub const fn as_u32(self) -> u32
pub const fn as_u32(self) -> u32
Returns the numeric domain ID value
§Example
use cctp_rs::DomainId;
assert_eq!(DomainId::Ethereum.as_u32(), 0);
assert_eq!(DomainId::Arbitrum.as_u32(), 3);Sourcepub const fn from_u32(value: u32) -> Option<Self>
pub const fn from_u32(value: u32) -> Option<Self>
Attempts to create a DomainId from a u32 value
§Example
use cctp_rs::DomainId;
assert_eq!(DomainId::from_u32(0), Some(DomainId::Ethereum));
assert_eq!(DomainId::from_u32(3), Some(DomainId::Arbitrum));
assert_eq!(DomainId::from_u32(11), Some(DomainId::Linea));
assert_eq!(DomainId::from_u32(999), None);Trait Implementations§
impl Copy for DomainId
impl Eq for DomainId
impl StructuralPartialEq for DomainId
Auto Trait Implementations§
impl Freeze for DomainId
impl RefUnwindSafe for DomainId
impl Send for DomainId
impl Sync for DomainId
impl Unpin for DomainId
impl UnwindSafe for DomainId
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.