Hardly had I got out of the house when it beign to rain.倒装句

问题描述:

Hardly had I got out of the house when it beign to rain.倒装句
其中had怎么用?用 was 两者有什么区别?

这是一个固定句式:
Hardly had sb.done sth.when...刚刚...就...
还有一个类似的句式:
No sooner had sb.done sth.than...刚刚..就...