pub trait HandleBased:
AsHandleRef
+ From<Handle>
+ Into<Handle> {
// Required method
fn invalidate(&mut self);
// Provided methods
fn close(self) -> impl Future<Output = Result<(), Error>> { ... }
fn duplicate_handle(
&self,
rights: Rights,
) -> impl Future<Output = Result<Self, Error>> { ... }
fn replace_handle(
self,
rights: Rights,
) -> impl Future<Output = Result<Self, Error>> { ... }
fn into_handle(self) -> Handle { ... }
fn from_handle(handle: Handle) -> Self { ... }
fn into_handle_based<H: HandleBased>(self) -> H { ... }
fn from_handle_based<H: HandleBased>(h: H) -> Self { ... }
}Required Methods§
Sourcefn invalidate(&mut self)
fn invalidate(&mut self)
Drop ownership of this handle and make it invalid, without closing the handle.
Provided Methods§
Sourcefn close(self) -> impl Future<Output = Result<(), Error>>
fn close(self) -> impl Future<Output = Result<(), Error>>
Closes this handle. Surfaces errors that dropping the handle will not.
Sourcefn duplicate_handle(
&self,
rights: Rights,
) -> impl Future<Output = Result<Self, Error>>
fn duplicate_handle( &self, rights: Rights, ) -> impl Future<Output = Result<Self, Error>>
Duplicate this handle.
Sourcefn replace_handle(
self,
rights: Rights,
) -> impl Future<Output = Result<Self, Error>>
fn replace_handle( self, rights: Rights, ) -> impl Future<Output = Result<Self, Error>>
Replace this handle with an equivalent one with different rights.
Sourcefn into_handle(self) -> Handle
fn into_handle(self) -> Handle
Convert this handle-based value into a pure Handle.
Sourcefn from_handle(handle: Handle) -> Self
fn from_handle(handle: Handle) -> Self
Construct a new handle-based value from a Handle.
Sourcefn into_handle_based<H: HandleBased>(self) -> H
fn into_handle_based<H: HandleBased>(self) -> H
Turn this handle-based value into one of a different type.
Sourcefn from_handle_based<H: HandleBased>(h: H) -> Self
fn from_handle_based<H: HandleBased>(h: H) -> Self
Turn another handle-based type into this one.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".