pub fn from_u8(x: u8) -> Result<Network> {
        match x {
            x if x == Network::Mainnet as u8 => Ok(Network::Mainnet),
            x if x == Network::Testnet as u8 => Ok(Network::Testnet),
            _ => {
                let msg = format!("Unknown network type: {}", x);
                Err(Error::BadArgument(msg))
            }
        }
    }
/// Converts an integer to a network type
Converts an integer to a network type
Converts an integer to a network type
pub fn from_u8(x: u8) -> Result<Network> {
        match x {
            x if x == Network::Mainnet as u8 => Ok(Network::Mainnet),
            x if x == Network::Testnet as u8 => Ok(Network::Testnet),
            _ => {
                let msg = format!("Unknown network type: {}", x);
                Err(Error::BadArgument(msg))
            }
        }
    }
pub fn from_u8 ( x : u8 ) -> Result < Network > { match x { x if x == Network :: Mainnet as u8 => Ok ( Network :: Mainnet ) , x if x == Network :: Testnet as u8 => Ok ( Network :: Testnet ) , _ => { let msg = format ! ( " " x ) ; Err ( Error :: BadArgument ( msg ) ) } } }
Converts an integer to a network type
Converts an integer to a network type
x
u8
x
u8