fn charge_gas<T: Trait, Tok: Token<T>>(
	gas_meter: &mut GasMeter<T>,
	metadata: &Tok::Metadata,
	token: Tok,
) -> Result<(), sandbox::HostError> {
	match gas_meter.charge(metadata, token) {
		GasMeterResult::Proceed => Ok(()),
		GasMeterResult::OutOfGas => Err(sandbox::HostError),
	}
}
/// Charge the gas meter with the specified token.
///
/// Returns `Err(HostError)` if there is not enough gas.
Charge the gas meter with the specified token.
Returns `Err(HostError)` if there is not enough gas.
Charge the gas meter with the specified token . Returns ` Err ( HostError ) ` if there is not enough gas .
fn charge_gas<T: Trait, Tok: Token<T>>(
	gas_meter: &mut GasMeter<T>,
	metadata: &Tok::Metadata,
	token: Tok,
) -> Result<(), sandbox::HostError> {
	match gas_meter.charge(metadata, token) {
		GasMeterResult::Proceed => Ok(()),
		GasMeterResult::OutOfGas => Err(sandbox::HostError),
	}
}
fn charge_gas < T : Trait , Tok : Token < T > > ( gas_meter : & mut GasMeter < T > , metadata : & Tok :: Metadata , token : Tok , ) -> Result < ( ) , sandbox :: HostError > { match gas_meter . charge ( metadata , token ) { GasMeterResult :: Proceed => Ok ( ( ) ) , GasMeterResult :: OutOfGas => Err ( sandbox :: HostError ) , } }
Charge the gas meter with the specified token.
Charge the gas meter with the specified token .
gas_meter
&mut GasMeter<T>
metadata
&Tok::Metadata
token
Tok
gas_meter
&mut GasMeter<T>
metadata
&Tok::Metadata
token
Tok