pub trait FileClose: FileOperation {
// Required methods
fn file_close(
&self,
file: Self::File,
) -> impl Future<Output = Result<()>> + Send;
fn file_close_submit(
&self,
file: Self::File,
) -> impl Future<Output = Result<()>> + Send;
}Expand description
Close exclusively owned file resources with completion or admission-only semantics.
Required Methods§
Sourcefn file_close(
&self,
file: Self::File,
) -> impl Future<Output = Result<()>> + Send
fn file_close( &self, file: Self::File, ) -> impl Future<Output = Result<()>> + Send
Consume an exclusively owned handle, wait for bounded admission and OS close completion, and report admission or close errors. This future is lazy and takes no cancellation token. Close does not synchronize file contents and is never retried after an error.
Finish all operations using the file first. Requesting cancellation or dropping an operation future alone does not establish that backend access has ended. Once admitted, close runs even if this future is dropped. Before admission, dropping the future releases the handle through ordinary destruction.
§Panics
Backends may panic if an abandoned operation still retains the file. Close never interrupts or joins other operations.
Sourcefn file_close_submit(
&self,
file: Self::File,
) -> impl Future<Output = Result<()>> + Send
fn file_close_submit( &self, file: Self::File, ) -> impl Future<Output = Result<()>> + Send
Consume an exclusively owned handle and wait only for bounded admission. The scheduler then owns completion even if this future is dropped. Errors report admission failure, not OS close failure; await file_close when execution errors matter.
The ownership, laziness, and outstanding-operation preconditions are the same as FileClose::file_close. Graceful scheduler shutdown drains accepted close jobs.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".