pub enum Network {
Mainnet,
Testnet,
}Expand description
Torvyon network identity.
Variants§
Mainnet
Live mainnet: torvyon-mainnet, bt1.
Testnet
Planned public testnet: torvyon-testnet-1, tbt1.
Implementations§
Source§impl Network
impl Network
Sourcepub const fn address_prefix(self) -> &'static str
pub const fn address_prefix(self) -> &'static str
Address prefix for this network.
Sourcepub fn from_chain_id(chain_id: &str) -> Self
pub fn from_chain_id(chain_id: &str) -> Self
Network for a known chain ID. Unknown IDs default to mainnet for backwards-compatible validation of custom/private mainnet-like chains.
Sourcepub fn from_address(address: &str) -> Self
pub fn from_address(address: &str) -> Self
Network implied by an address prefix, if recognized.
Trait Implementations§
impl Copy for Network
impl Eq for Network
impl StructuralPartialEq for Network
Auto Trait Implementations§
impl Freeze for Network
impl RefUnwindSafe for Network
impl Send for Network
impl Sync for Network
impl Unpin for Network
impl UnsafeUnpin for Network
impl UnwindSafe for Network
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