dope-uring 0.77.0

Owned io_uring backend for dope
Documentation
use crate::{
    Backend,
    sockets::reuse::{Installer, program},
};
use dope_sys::io::socket::route::{Plan, Source, count::Index};
use std::os::fd::BorrowedFd;

impl Source for Backend {
    type Storage = [libc::sock_filter; program::MAX];
    type Install<'a> = Installer<'a>;
    type Ready = ();
    type Lease<'a> = BorrowedFd<'a>;

    const STORAGE: Self::Storage = [program::EMPTY; program::MAX];

    fn try_prepare(
        filter: &mut Self::Storage,
        plan: Plan,
    ) -> Result<(Self::Install<'_>, Self::Ready), Plan> {
        let value = Installer {
            plan,
            filter: program::build(filter, plan, Some(Index::ZERO)),
        };
        Ok((value, ()))
    }

    fn lease<'a>((): &(), socket: BorrowedFd<'a>) -> Self::Lease<'a> {
        socket
    }
}