add swhid() method to from_disk classes
It is currently a bit cumbersome to obtain a (Core)SWHID instance out of swh.model.from_disk classes like Content and Directory, but there is client code that needs to do so (e.g., in swh-identify and swh-scanner).
It would be nice to have a dedicated swhid() method on those classes to make that easy.
Migrated from T3393 (view on Phabricator)