rustpkg: Add preliminary imperative API support