Enum NamedChain
#[non_exhaustive]#[repr(u64)]pub enum NamedChain {
Show 201 variants
Mainnet = 1,
Morden = 2,
Ropsten = 3,
Rinkeby = 4,
Goerli = 5,
Optimism = 10,
Flare = 14,
Elastos = 20,
Cronos = 25,
Rsk = 30,
RskTestnet = 31,
TelosEvm = 40,
TelosEvmTestnet = 41,
Kovan = 42,
Crab = 44,
Darwinia = 46,
XdcMainnet = 50,
XdcTestnet = 51,
BinanceSmartChain = 56,
OptimismKovan = 69,
CfxTestnet = 71,
Sokol = 77,
Viction = 88,
BinanceSmartChainTestnet = 97,
Poa = 99,
Gnosis = 100,
FlareCoston2 = 114,
Fuse = 122,
Unichain = 130,
Polygon = 137,
Monad = 143,
Sonic = 146,
Shimmer = 148,
Redbelly = 151,
RedbellyTestnet = 153,
OpBNBMainnet = 204,
HappychainTestnet = 216,
Lens = 232,
Fantom = 250,
Fraxtal = 252,
Boba = 288,
ZkSyncTestnet = 300,
FilecoinMainnet = 314,
ZkSync = 324,
CronosTestnet = 338,
Pulsechain = 369,
Syndr = 404,
OptimismGoerli = 420,
Pgn = 424,
World = 480,
AcalaMandalaTestnet = 595,
KaruraTestnet = 596,
AcalaTestnet = 597,
BattleChain = 626,
BattleChainTestnet = 627,
Karura = 686,
Koi = 701,
CantoTestnet = 740,
Acala = 787,
ModeSepolia = 919,
PulsechainTestnet = 943,
StableMainnet = 988,
Hyperliquid = 999,
Cfx = 1_030,
Metis = 1_088,
Core = 1_116,
Lisk = 1_135,
MoonbeamDev = 1_281,
Moonbeam = 1_284,
Moonriver = 1_285,
Moonbase = 1_287,
UnichainSepolia = 1_301,
SeiTestnet = 1_328,
Sei = 1_329,
Dev = 1_337,
InjectiveTestnet = 1_439,
Vana = 1_480,
Story = 1_514,
GravityAlphaMainnet = 1_625,
Pharos = 1_672,
Injective = 1_776,
Soneium = 1_868,
SoneiumMinatoTestnet = 1_946,
Ronin = 2_020,
StableTestnet = 2_201,
FraxtalTestnet = 2_522,
Abstract = 2_741,
FantomTestnet = 4_002,
Merlin = 4_200,
Tempo = 4_217,
MegaEth = 4_326,
MemeCore = 4_352,
Robinhood = 4_663,
Iotex = 4_689,
WorldSepolia = 4_801,
Mantle = 5_000,
MantleSepolia = 5_003,
OpBNBTestnet = 5_611,
MegaEthTestnet = 6_343,
Zeta = 7_000,
Canto = 7_700,
Kaia = 8_217,
Base = 8_453,
EvmosTestnet = 9_000,
Evmos = 9_001,
Plasma = 9_745,
PlasmaTestnet = 9_746,
MonadTestnet = 10_143,
Chiado = 10_200,
AbstractTestnet = 11_124,
Cannon = 13_370,
Immutable = 13_371,
ImmutableTestnet = 13_473,
GravityAlphaTestnetSepolia = 13_505,
SignetPecorino = 14_174,
SonicTestnet = 14_601,
Holesky = 17_000,
FluentDevnet = 20_993,
FluentTestnet = 20_994,
Fluent = 25_363,
Oasis = 26_863,
TempoDevnet = 31_318,
AnvilHardhat = 31_337,
Curtis = 33_111,
ApeChain = 33_139,
Mode = 34_443,
LensTestnet = 37_111,
Arbitrum = 42_161,
ArbitrumNova = 42_170,
Celo = 42_220,
EmeraldTestnet = 42_261,
Emerald = 42_262,
TempoTestnet = 42_429,
TempoModerato = 42_431,
Etherlink = 42_793,
AvalancheFuji = 43_113,
Avalanche = 43_114,
Formicarium = 43_521,
Insectarium = 43_522,
RobinhoodTestnet = 46_630,
Sophon = 50_104,
Superposition = 55_244,
Ink = 57_073,
PgnSepolia = 58_008,
LineaGoerli = 59_140,
LineaSepolia = 59_141,
Linea = 59_144,
Bob = 60_808,
Treasure = 61_166,
RadiusTestnet = 72_344,
PolygonAmoy = 80_002,
BerachainBepolia = 80_069,
Berachain = 80_094,
Blast = 81_457,
BaseGoerli = 84_531,
BaseSepolia = 84_532,
Plume = 98_866,
PlumeTestnet = 98_867,
SuperpositionTestnet = 98_985,
Gravity = 127_001,
EtherlinkShadownet = 127_823,
Taiko = 167_000,
TaikoHekla = 167_009,
Bitlayer = 200_901,
RoninTestnet = 202_601,
FilecoinCalibrationTestnet = 314_159,
ArbitrumTestnet = 421_611,
ArbitrumGoerli = 421_613,
ArbitrumSepolia = 421_614,
SyndrSepolia = 444_444,
AutonomysNovaTestnet = 490_000,
ScrollSepolia = 534_351,
Scroll = 534_352,
Hoodi = 560_048,
Xai = 660_279,
PharosTestnet = 688_688,
Radius = 723_487,
Katana = 747_474,
InkSepolia = 763_373,
BobSepolia = 808_813,
Odyssey = 911_867,
TreasureTopaz = 978_658,
ArcTestnet = 5_042_002,
Zora = 7_777_777,
CeloSepolia = 11_142_220,
Sepolia = 11_155_111,
OptimismSepolia = 11_155_420,
Corn = 21_000_000,
CornTestnet = 21_000_001,
BlastSepolia = 168_587_773,
SkaleBaseSepoliaTestnet = 324_705_682,
PolkadotTestnet = 420_420_417,
Kusama = 420_420_418,
Polkadot = 420_420_419,
SophonTestnet = 531_050_104,
Degen = 666_666_666,
ZoraSepolia = 999_999_999,
SkaleBase = 1_187_947_933,
Aurora = 1_313_161_554,
AuroraTestnet = 1_313_161_555,
XaiSepolia = 37_714_555_429,
}Expand description
An Ethereum EIP-155 chain.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Mainnet = 1
Morden = 2
Ropsten = 3
Rinkeby = 4
Goerli = 5
Optimism = 10
Flare = 14
Elastos = 20
Cronos = 25
Rsk = 30
RskTestnet = 31
TelosEvm = 40
TelosEvmTestnet = 41
Kovan = 42
Crab = 44
Darwinia = 46
XdcMainnet = 50
XdcTestnet = 51
BinanceSmartChain = 56
OptimismKovan = 69
CfxTestnet = 71
Sokol = 77
Viction = 88
BinanceSmartChainTestnet = 97
Poa = 99
Gnosis = 100
FlareCoston2 = 114
Fuse = 122
Unichain = 130
Polygon = 137
Monad = 143
Sonic = 146
Shimmer = 148
Redbelly = 151
RedbellyTestnet = 153
OpBNBMainnet = 204
HappychainTestnet = 216
Lens = 232
Fantom = 250
Fraxtal = 252
Boba = 288
ZkSyncTestnet = 300
FilecoinMainnet = 314
ZkSync = 324
CronosTestnet = 338
Pulsechain = 369
Syndr = 404
OptimismGoerli = 420
Pgn = 424
World = 480
AcalaMandalaTestnet = 595
KaruraTestnet = 596
AcalaTestnet = 597
BattleChain = 626
BattleChainTestnet = 627
Karura = 686
Koi = 701
CantoTestnet = 740
Acala = 787
ModeSepolia = 919
PulsechainTestnet = 943
StableMainnet = 988
Hyperliquid = 999
Cfx = 1_030
Metis = 1_088
Core = 1_116
Lisk = 1_135
MoonbeamDev = 1_281
Moonbeam = 1_284
Moonriver = 1_285
Moonbase = 1_287
UnichainSepolia = 1_301
SeiTestnet = 1_328
Sei = 1_329
Dev = 1_337
InjectiveTestnet = 1_439
Vana = 1_480
Story = 1_514
GravityAlphaMainnet = 1_625
Pharos = 1_672
Injective = 1_776
Soneium = 1_868
SoneiumMinatoTestnet = 1_946
Ronin = 2_020
StableTestnet = 2_201
FraxtalTestnet = 2_522
Abstract = 2_741
FantomTestnet = 4_002
Merlin = 4_200
Tempo = 4_217
MegaEth = 4_326
MemeCore = 4_352
Robinhood = 4_663
Iotex = 4_689
WorldSepolia = 4_801
Mantle = 5_000
MantleSepolia = 5_003
OpBNBTestnet = 5_611
MegaEthTestnet = 6_343
Zeta = 7_000
Canto = 7_700
Kaia = 8_217
Base = 8_453
EvmosTestnet = 9_000
Evmos = 9_001
Plasma = 9_745
PlasmaTestnet = 9_746
MonadTestnet = 10_143
Chiado = 10_200
AbstractTestnet = 11_124
Cannon = 13_370
Immutable = 13_371
ImmutableTestnet = 13_473
GravityAlphaTestnetSepolia = 13_505
SignetPecorino = 14_174
SonicTestnet = 14_601
Holesky = 17_000
FluentDevnet = 20_993
FluentTestnet = 20_994
Fluent = 25_363
Oasis = 26_863
TempoDevnet = 31_318
AnvilHardhat = 31_337
Curtis = 33_111
ApeChain = 33_139
Mode = 34_443
LensTestnet = 37_111
Arbitrum = 42_161
ArbitrumNova = 42_170
Celo = 42_220
EmeraldTestnet = 42_261
Emerald = 42_262
TempoTestnet = 42_429
TempoModerato = 42_431
Etherlink = 42_793
AvalancheFuji = 43_113
Avalanche = 43_114
Formicarium = 43_521
Insectarium = 43_522
RobinhoodTestnet = 46_630
Sophon = 50_104
Superposition = 55_244
Ink = 57_073
PgnSepolia = 58_008
LineaGoerli = 59_140
LineaSepolia = 59_141
Linea = 59_144
Bob = 60_808
Treasure = 61_166
RadiusTestnet = 72_344
PolygonAmoy = 80_002
BerachainBepolia = 80_069
Berachain = 80_094
Blast = 81_457
BaseGoerli = 84_531
BaseSepolia = 84_532
Plume = 98_866
PlumeTestnet = 98_867
SuperpositionTestnet = 98_985
Gravity = 127_001
EtherlinkShadownet = 127_823
Taiko = 167_000
TaikoHekla = 167_009
Bitlayer = 200_901
RoninTestnet = 202_601
FilecoinCalibrationTestnet = 314_159
ArbitrumTestnet = 421_611
ArbitrumGoerli = 421_613
ArbitrumSepolia = 421_614
SyndrSepolia = 444_444
AutonomysNovaTestnet = 490_000
ScrollSepolia = 534_351
Scroll = 534_352
Hoodi = 560_048
Xai = 660_279
PharosTestnet = 688_688
Radius = 723_487
Katana = 747_474
InkSepolia = 763_373
BobSepolia = 808_813
Odyssey = 911_867
TreasureTopaz = 978_658
ArcTestnet = 5_042_002
Zora = 7_777_777
CeloSepolia = 11_142_220
Sepolia = 11_155_111
OptimismSepolia = 11_155_420
Corn = 21_000_000
CornTestnet = 21_000_001
BlastSepolia = 168_587_773
SkaleBaseSepoliaTestnet = 324_705_682
PolkadotTestnet = 420_420_417
Kusama = 420_420_418
Polkadot = 420_420_419
SophonTestnet = 531_050_104
Degen = 666_666_666
ZoraSepolia = 999_999_999
SkaleBase = 1_187_947_933
Aurora = 1_313_161_554
AuroraTestnet = 1_313_161_555
XaiSepolia = 37_714_555_429
Implementations§
§impl NamedChain
impl NamedChain
pub const VARIANTS: &'static [NamedChain]
pub const VARIANTS: &'static [NamedChain]
All named chains in declaration order.
pub const VARIANT_NAMES: &'static [&'static str]
pub const VARIANT_NAMES: &'static [&'static str]
All named chain string representations in declaration order.
pub const fn from_chain_id(id: u64) -> Option<NamedChain>
pub const fn from_chain_id(id: u64) -> Option<NamedChain>
Returns the chain for the given EIP-155 chain ID.
pub const fn is_ethereum(&self) -> bool
pub const fn is_ethereum(&self) -> bool
Returns true if this chain is Ethereum or an Ethereum testnet.
pub const fn is_optimism(self) -> bool
pub const fn is_optimism(self) -> bool
Returns true if the chain contains Optimism configuration.
pub const fn is_polygon(self) -> bool
pub const fn is_polygon(self) -> bool
Returns true if the chain contains Polygon configuration.
pub const fn is_arbitrum(self) -> bool
pub const fn is_arbitrum(self) -> bool
Returns true if the chain contains Arbitrum configuration.
pub const fn is_elastic(self) -> bool
pub const fn is_elastic(self) -> bool
Returns true if the chain contains Elastic Network configuration.
pub const fn is_custom_sourcify(self) -> bool
pub const fn is_custom_sourcify(self) -> bool
Returns true if the chain uses a custom Sourcify-compatible API.
pub const fn supports_shanghai(self) -> bool
pub const fn supports_shanghai(self) -> bool
Returns whether the chain supports the Shanghai hardfork.
pub const fn is_testnet(self) -> bool
pub const fn is_testnet(self) -> bool
Returns whether the chain is a testnet.
pub const fn native_currency_symbol(self) -> Option<&'static str>
pub const fn native_currency_symbol(self) -> Option<&'static str>
Returns the symbol of the chain’s native currency.
pub const fn etherscan_urls(self) -> Option<(&'static str, &'static str)>
pub const fn etherscan_urls(self) -> Option<(&'static str, &'static str)>
Returns the chain’s blockchain explorer and its API URLs.
pub const fn etherscan_api_key_name(self) -> Option<&'static str>
pub const fn etherscan_api_key_name(self) -> Option<&'static str>
Returns the chain’s blockchain explorer API key environment variable name.
pub const fn wrapped_native_token(self) -> Option<Address>
pub const fn wrapped_native_token(self) -> Option<Address>
Returns the address of the most popular wrapped native token address.
§impl NamedChain
impl NamedChain
pub fn iter() -> NamedChainIter
pub fn iter() -> NamedChainIter
Returns an iterator over all named chains.
pub const fn average_blocktime_hint(self) -> Option<Duration>
pub const fn average_blocktime_hint(self) -> Option<Duration>
Returns the chain’s average blocktime, if applicable.
pub fn etherscan_api_key(self) -> Option<String>
Available on crate feature std only.
pub fn etherscan_api_key(self) -> Option<String>
std only.Returns the chain’s blockchain explorer API key from the environment.
pub fn public_dns_network_protocol(self) -> Option<String>
pub fn public_dns_network_protocol(self) -> Option<String>
Returns the address of the public DNS node list for the given chain.
Trait Implementations§
§impl AsRef<str> for NamedChain
impl AsRef<str> for NamedChain
§impl Clone for NamedChain
impl Clone for NamedChain
§fn clone(&self) -> NamedChain
fn clone(&self) -> NamedChain
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for NamedChain
§impl Debug for NamedChain
impl Debug for NamedChain
§impl Decodable for NamedChain
Available on crate feature rlp only.
impl Decodable for NamedChain
rlp only.§fn decode(buf: &mut &[u8]) -> Result<NamedChain, Error>
fn decode(buf: &mut &[u8]) -> Result<NamedChain, Error>
buf must be advanced past
the decoded object.§impl Default for NamedChain
impl Default for NamedChain
§fn default() -> NamedChain
fn default() -> NamedChain
§impl<'de> Deserialize<'de> for NamedChain
Available on crate feature serde only.
impl<'de> Deserialize<'de> for NamedChain
serde only.§fn deserialize<D>(
deserializer: D,
) -> Result<NamedChain, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<NamedChain, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
§impl Display for NamedChain
impl Display for NamedChain
§impl Encodable for NamedChain
Available on crate feature rlp only.
impl Encodable for NamedChain
rlp only.impl Eq for NamedChain
§impl From<&NamedChain> for &'static str
impl From<&NamedChain> for &'static str
§fn from(chain: &NamedChain) -> &'static str
fn from(chain: &NamedChain) -> &'static str
§impl From<NamedChain> for Chain
impl From<NamedChain> for Chain
§fn from(id: NamedChain) -> Chain
fn from(id: NamedChain) -> Chain
§impl From<NamedChain> for &'static str
impl From<NamedChain> for &'static str
§fn from(chain: NamedChain) -> &'static str
fn from(chain: NamedChain) -> &'static str
§impl FromStr for NamedChain
impl FromStr for NamedChain
§impl Hash for NamedChain
impl Hash for NamedChain
§impl Ord for NamedChain
impl Ord for NamedChain
§fn cmp(&self, other: &NamedChain) -> Ordering
fn cmp(&self, other: &NamedChain) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
§impl PartialEq for NamedChain
impl PartialEq for NamedChain
§impl PartialEq<u64> for NamedChain
impl PartialEq<u64> for NamedChain
§impl PartialOrd for NamedChain
impl PartialOrd for NamedChain
§impl PartialOrd<u64> for NamedChain
impl PartialOrd<u64> for NamedChain
§impl Serialize for NamedChain
Available on crate feature serde only.
impl Serialize for NamedChain
serde only.§fn serialize<S>(
&self,
s: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
s: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
impl StructuralPartialEq for NamedChain
§impl TryFrom<&str> for NamedChain
impl TryFrom<&str> for NamedChain
§impl TryFrom<Chain> for NamedChain
impl TryFrom<Chain> for NamedChain
§type Error = <NamedChain as TryFrom<u64>>::Error
type Error = <NamedChain as TryFrom<u64>>::Error
§fn try_from(
chain: Chain,
) -> Result<NamedChain, <NamedChain as TryFrom<Chain>>::Error>
fn try_from( chain: Chain, ) -> Result<NamedChain, <NamedChain as TryFrom<Chain>>::Error>
§impl TryFrom<i8> for NamedChain
impl TryFrom<i8> for NamedChain
§type Error = TryFromPrimitiveError<NamedChain>
type Error = TryFromPrimitiveError<NamedChain>
§fn try_from(value: i8) -> Result<NamedChain, <NamedChain as TryFrom<i8>>::Error>
fn try_from(value: i8) -> Result<NamedChain, <NamedChain as TryFrom<i8>>::Error>
§impl TryFrom<i16> for NamedChain
impl TryFrom<i16> for NamedChain
§type Error = TryFromPrimitiveError<NamedChain>
type Error = TryFromPrimitiveError<NamedChain>
§fn try_from(
value: i16,
) -> Result<NamedChain, <NamedChain as TryFrom<i16>>::Error>
fn try_from( value: i16, ) -> Result<NamedChain, <NamedChain as TryFrom<i16>>::Error>
§impl TryFrom<i32> for NamedChain
impl TryFrom<i32> for NamedChain
§type Error = TryFromPrimitiveError<NamedChain>
type Error = TryFromPrimitiveError<NamedChain>
§fn try_from(
value: i32,
) -> Result<NamedChain, <NamedChain as TryFrom<i32>>::Error>
fn try_from( value: i32, ) -> Result<NamedChain, <NamedChain as TryFrom<i32>>::Error>
§impl TryFrom<isize> for NamedChain
impl TryFrom<isize> for NamedChain
§type Error = TryFromPrimitiveError<NamedChain>
type Error = TryFromPrimitiveError<NamedChain>
§fn try_from(
value: isize,
) -> Result<NamedChain, <NamedChain as TryFrom<isize>>::Error>
fn try_from( value: isize, ) -> Result<NamedChain, <NamedChain as TryFrom<isize>>::Error>
§impl TryFrom<u8> for NamedChain
impl TryFrom<u8> for NamedChain
§type Error = TryFromPrimitiveError<NamedChain>
type Error = TryFromPrimitiveError<NamedChain>
§fn try_from(value: u8) -> Result<NamedChain, <NamedChain as TryFrom<u8>>::Error>
fn try_from(value: u8) -> Result<NamedChain, <NamedChain as TryFrom<u8>>::Error>
§impl TryFrom<u16> for NamedChain
impl TryFrom<u16> for NamedChain
§type Error = TryFromPrimitiveError<NamedChain>
type Error = TryFromPrimitiveError<NamedChain>
§fn try_from(
value: u16,
) -> Result<NamedChain, <NamedChain as TryFrom<u16>>::Error>
fn try_from( value: u16, ) -> Result<NamedChain, <NamedChain as TryFrom<u16>>::Error>
§impl TryFrom<u32> for NamedChain
impl TryFrom<u32> for NamedChain
§type Error = TryFromPrimitiveError<NamedChain>
type Error = TryFromPrimitiveError<NamedChain>
§fn try_from(
value: u32,
) -> Result<NamedChain, <NamedChain as TryFrom<u32>>::Error>
fn try_from( value: u32, ) -> Result<NamedChain, <NamedChain as TryFrom<u32>>::Error>
§impl TryFrom<u64> for NamedChain
impl TryFrom<u64> for NamedChain
§type Error = TryFromPrimitiveError<NamedChain>
type Error = TryFromPrimitiveError<NamedChain>
§fn try_from(
value: u64,
) -> Result<NamedChain, <NamedChain as TryFrom<u64>>::Error>
fn try_from( value: u64, ) -> Result<NamedChain, <NamedChain as TryFrom<u64>>::Error>
§impl TryFrom<usize> for NamedChain
impl TryFrom<usize> for NamedChain
§type Error = TryFromPrimitiveError<NamedChain>
type Error = TryFromPrimitiveError<NamedChain>
§fn try_from(
value: usize,
) -> Result<NamedChain, <NamedChain as TryFrom<usize>>::Error>
fn try_from( value: usize, ) -> Result<NamedChain, <NamedChain as TryFrom<usize>>::Error>
§impl TryFromPrimitive for NamedChain
impl TryFromPrimitive for NamedChain
const NAME: &'static str = "NamedChain"
type Primitive = u64
type Error = TryFromPrimitiveError<NamedChain>
fn try_from_primitive( number: <NamedChain as TryFromPrimitive>::Primitive, ) -> Result<NamedChain, <NamedChain as TryFromPrimitive>::Error>
Auto Trait Implementations§
impl Freeze for NamedChain
impl RefUnwindSafe for NamedChain
impl Send for NamedChain
impl Sync for NamedChain
impl Unpin for NamedChain
impl UnsafeUnpin for NamedChain
impl UnwindSafe for NamedChain
Blanket Implementations§
§impl<T> AsUncased for T
impl<T> AsUncased for T
§fn as_uncased(&self) -> &UncasedStr
fn as_uncased(&self) -> &UncasedStr
self to an [UncasedStr].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
impl<'de, T> BorrowedRpcObject<'de> for Twhere
T: RpcBorrow<'de> + RpcSend,
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> Conv for T
impl<T> Conv for T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<TxEnv, T> FromRecoveredTx<&T> for TxEnvwhere
TxEnv: FromRecoveredTx<T>,
impl<TxEnv, T> FromRecoveredTx<&T> for TxEnvwhere
TxEnv: FromRecoveredTx<T>,
§fn from_recovered_tx(tx: &&T, sender: Address) -> TxEnv
fn from_recovered_tx(tx: &&T, sender: Address) -> TxEnv
TxEnv] from a transaction and a sender address.§impl<TxEnv, T> FromTxWithEncoded<&T> for TxEnvwhere
TxEnv: FromTxWithEncoded<T>,
impl<TxEnv, T> FromTxWithEncoded<&T> for TxEnvwhere
TxEnv: FromTxWithEncoded<T>,
§fn from_encoded_tx(tx: &&T, sender: Address, encoded: Bytes) -> TxEnv
fn from_encoded_tx(tx: &&T, sender: Address, encoded: Bytes) -> TxEnv
TxEnv] from a transaction, its sender, and encoded transaction bytes.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling [Attribute] value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi [Quirk] value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the [Condition] value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<'de, T> RpcBorrow<'de> for T
impl<T> RpcObject for Twhere
T: RpcSend + RpcRecv,
impl<T> RpcRecv for T
impl<T> RpcSend for T
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.§impl<Q> ToOwnedEquivalent<<Q as ToOwned>::Owned> for Q
impl<Q> ToOwnedEquivalent<<Q as ToOwned>::Owned> for Q
fn to_owned_equivalent(&self) -> <Q as ToOwned>::Owned
§impl<T> TryConv for T
impl<T> TryConv for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 8 bytes
Size for each variant:
Mainnet: 0 bytesMorden: 0 bytesRopsten: 0 bytesRinkeby: 0 bytesGoerli: 0 bytesOptimism: 0 bytesFlare: 0 bytesElastos: 0 bytesCronos: 0 bytesRsk: 0 bytesRskTestnet: 0 bytesTelosEvm: 0 bytesTelosEvmTestnet: 0 bytesKovan: 0 bytesCrab: 0 bytesDarwinia: 0 bytesXdcMainnet: 0 bytesXdcTestnet: 0 bytesBinanceSmartChain: 0 bytesOptimismKovan: 0 bytesCfxTestnet: 0 bytesSokol: 0 bytesViction: 0 bytesBinanceSmartChainTestnet: 0 bytesPoa: 0 bytesGnosis: 0 bytesFlareCoston2: 0 bytesFuse: 0 bytesUnichain: 0 bytesPolygon: 0 bytesMonad: 0 bytesSonic: 0 bytesShimmer: 0 bytesRedbelly: 0 bytesRedbellyTestnet: 0 bytesOpBNBMainnet: 0 bytesHappychainTestnet: 0 bytesLens: 0 bytesFantom: 0 bytesFraxtal: 0 bytesBoba: 0 bytesZkSyncTestnet: 0 bytesFilecoinMainnet: 0 bytesZkSync: 0 bytesCronosTestnet: 0 bytesPulsechain: 0 bytesSyndr: 0 bytesOptimismGoerli: 0 bytesPgn: 0 bytesWorld: 0 bytesAcalaMandalaTestnet: 0 bytesKaruraTestnet: 0 bytesAcalaTestnet: 0 bytesBattleChain: 0 bytesBattleChainTestnet: 0 bytesKarura: 0 bytesKoi: 0 bytesCantoTestnet: 0 bytesAcala: 0 bytesModeSepolia: 0 bytesPulsechainTestnet: 0 bytesStableMainnet: 0 bytesHyperliquid: 0 bytesCfx: 0 bytesMetis: 0 bytesCore: 0 bytesLisk: 0 bytesMoonbeamDev: 0 bytesMoonbeam: 0 bytesMoonriver: 0 bytesMoonbase: 0 bytesUnichainSepolia: 0 bytesSeiTestnet: 0 bytesSei: 0 bytesDev: 0 bytesInjectiveTestnet: 0 bytesVana: 0 bytesStory: 0 bytesGravityAlphaMainnet: 0 bytesPharos: 0 bytesInjective: 0 bytesSoneium: 0 bytesSoneiumMinatoTestnet: 0 bytesRonin: 0 bytesStableTestnet: 0 bytesFraxtalTestnet: 0 bytesAbstract: 0 bytesFantomTestnet: 0 bytesMerlin: 0 bytesTempo: 0 bytesMegaEth: 0 bytesMemeCore: 0 bytesRobinhood: 0 bytesIotex: 0 bytesWorldSepolia: 0 bytesMantle: 0 bytesMantleSepolia: 0 bytesOpBNBTestnet: 0 bytesMegaEthTestnet: 0 bytesZeta: 0 bytesCanto: 0 bytesKaia: 0 bytesBase: 0 bytesEvmosTestnet: 0 bytesEvmos: 0 bytesPlasma: 0 bytesPlasmaTestnet: 0 bytesMonadTestnet: 0 bytesChiado: 0 bytesAbstractTestnet: 0 bytesCannon: 0 bytesImmutable: 0 bytesImmutableTestnet: 0 bytesGravityAlphaTestnetSepolia: 0 bytesSignetPecorino: 0 bytesSonicTestnet: 0 bytesHolesky: 0 bytesFluentDevnet: 0 bytesFluentTestnet: 0 bytesFluent: 0 bytesOasis: 0 bytesTempoDevnet: 0 bytesAnvilHardhat: 0 bytesCurtis: 0 bytesApeChain: 0 bytesMode: 0 bytesLensTestnet: 0 bytesArbitrum: 0 bytesArbitrumNova: 0 bytesCelo: 0 bytesEmeraldTestnet: 0 bytesEmerald: 0 bytesTempoTestnet: 0 bytesTempoModerato: 0 bytesEtherlink: 0 bytesAvalancheFuji: 0 bytesAvalanche: 0 bytesFormicarium: 0 bytesInsectarium: 0 bytesRobinhoodTestnet: 0 bytesSophon: 0 bytesSuperposition: 0 bytesInk: 0 bytesPgnSepolia: 0 bytesLineaGoerli: 0 bytesLineaSepolia: 0 bytesLinea: 0 bytesBob: 0 bytesTreasure: 0 bytesRadiusTestnet: 0 bytesPolygonAmoy: 0 bytesBerachainBepolia: 0 bytesBerachain: 0 bytesBlast: 0 bytesBaseGoerli: 0 bytesBaseSepolia: 0 bytesPlume: 0 bytesPlumeTestnet: 0 bytesSuperpositionTestnet: 0 bytesGravity: 0 bytesEtherlinkShadownet: 0 bytesTaiko: 0 bytesTaikoHekla: 0 bytesBitlayer: 0 bytesRoninTestnet: 0 bytesFilecoinCalibrationTestnet: 0 bytesArbitrumTestnet: 0 bytesArbitrumGoerli: 0 bytesArbitrumSepolia: 0 bytesSyndrSepolia: 0 bytesAutonomysNovaTestnet: 0 bytesScrollSepolia: 0 bytesScroll: 0 bytesHoodi: 0 bytesXai: 0 bytesPharosTestnet: 0 bytesRadius: 0 bytesKatana: 0 bytesInkSepolia: 0 bytesBobSepolia: 0 bytesOdyssey: 0 bytesTreasureTopaz: 0 bytesArcTestnet: 0 bytesZora: 0 bytesCeloSepolia: 0 bytesSepolia: 0 bytesOptimismSepolia: 0 bytesCorn: 0 bytesCornTestnet: 0 bytesBlastSepolia: 0 bytesSkaleBaseSepoliaTestnet: 0 bytesPolkadotTestnet: 0 bytesKusama: 0 bytesPolkadot: 0 bytesSophonTestnet: 0 bytesDegen: 0 bytesZoraSepolia: 0 bytesSkaleBase: 0 bytesAurora: 0 bytesAuroraTestnet: 0 bytesXaiSepolia: 0 bytes