pub trait FastCloseable: Send {
    // Provided method
    fn fast_close(self) -> FastClose<Self> 
       where Self: Sized { ... }
}
Expand description

Indicates compatibility with FastClose, providing a convenience method for wrapping a type

§Implementing FastCloseable

FastCloseable can be implemented on any type that will trigger a call to Windows’ CloseHandle on drop

Phrased another way, you can implement FastCloseable on any file wrapper type that is:

  • Owned, not borrowed ('static)
  • Not reference counted (use FastClose inside of an Arc, not outside)
  • Send
  • !Clone

You should use the default implementation for fast_close(), as it is the only public API for constructing a FastClose that doesn’t rely on the FastCloseable trait (FastClose::new just calls .fast_close() on the parameter)

Provided Methods§

source

fn fast_close(self) -> FastClose<Self>
where Self: Sized,

Wraps self in FastClose

Implementations on Foreign Types§

source§

impl FastCloseable for File

Implementors§