pub fn managed_resource<T, F>(resource: T, cleanup: F) -> ResourceGuard<T>Expand description
Convenience function to create a simple resource guard
This function creates a guard that will call the cleanup function when the resource is no longer needed.