base-scheduler 0.3.1

Explicit, runtime-independent scheduler capabilities for protocol libraries
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Released under the MIT License.
// Copyright, 2026, by Samuel Williams.

use crate::{FileOperation, FileWriter};
use std::io;

/// Construct a sequential file writer bound to this scheduler. Backends select the handle representation; protocols need no monitor or raw dispatch capabilities.
pub trait FileWriting: FileOperation {
    /// The scheduler-bound writer returned by [`file_writer`](Self::file_writer).
    type Writer<'scheduler>: FileWriter + 'scheduler
    where
        Self: 'scheduler;

    /// 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.
    fn file_writer(&self, file: &Self::File) -> io::Result<Self::Writer<'_>>;
}