dope_sys/io/socket/route/source.rs
1use std::os::fd;
2
3use crate::io::socket::route::{Attach, Plan};
4
5/// Selects routing authority without exposing the native program owner.
6pub trait Source {
7 type Storage;
8 type Install<'a>: Attach;
9 type Ready;
10 type Lease<'a>: fd::AsFd;
11
12 const STORAGE: Self::Storage;
13
14 fn try_prepare(
15 storage: &mut Self::Storage,
16 plan: Plan,
17 ) -> Result<(Self::Install<'_>, Self::Ready), Plan>;
18 fn lease<'a>(ready: &Self::Ready, socket: fd::BorrowedFd<'a>) -> Self::Lease<'a>;
19}