base_scheduler/file_writing.rs
1// Released under the MIT License.
2// Copyright, 2026, by Samuel Williams.
3
4use crate::{FileOperation, FileWriter};
5use std::io;
6
7/// Construct a sequential file writer bound to this scheduler. Backends select the handle representation; protocols need no monitor or raw dispatch capabilities.
8pub trait FileWriting: FileOperation {
9 /// The scheduler-bound writer returned by [`file_writer`](Self::file_writer).
10 type Writer<'scheduler>: FileWriter + 'scheduler
11 where
12 Self: 'scheduler;
13
14 /// Retain the file and reusable backend state without submitting I/O. The file reference need not live as long as the returned handle. Cancellation remains an operation argument.
15 fn file_writer(&self, file: &Self::File) -> io::Result<Self::Writer<'_>>;
16}