dope-core 0.75.0

Owned native I/O and completion driver for dope
Documentation
use std::marker;

pub(crate) use echo::Echo;
use o3::alloc;

mod echo;

use crate::driver::{self, retained::flight};

/// Prepares this driver's arena while retaining its exclusive preparation loan.
pub(in crate::driver) fn prepare<'a, 'd, Tags, const GROUPS: usize, B>(
    local: &'a mut driver::life::Local<'d>,
    need: flight::Need<Tags, GROUPS, B>,
) -> Result<flight::Prepared<'a, 'd, Tags, GROUPS, B>, alloc::Error> {
    // SAFETY: this consumed Context exclusively lends preparation for 'a.
    // Its arena already lives for 'd; Prepared retains the short loan while
    // topology mutation remains inside the original directory's UnsafeCell.
    let prepared = unsafe {
        local
            .flights
            .0
            .try_batch::<GROUPS, B>(need.into_caps().map(flight::Capacity::get))?
    };
    Ok(flight::Prepared {
        prepared,
        driver: local.driver.brand,
        tags: marker::PhantomData,
    })
}