Make Ext a trait

This commit is contained in:
Ruihan Li
2024-12-03 09:47:47 +08:00
committed by Tate, Hongliang Tian
parent 20ee05e8e0
commit fa76afb3a9
16 changed files with 194 additions and 160 deletions

View File

@ -0,0 +1,16 @@
// SPDX-License-Identifier: MPL-2.0
use crate::iface::ScheduleNextPoll;
/// Extension to be implemented by users of this crate.
///
/// This should be implemented on an empty type that carries no data, since the type will never
/// actually be instantiated.
///
/// The purpose of having this trait is to allow users of this crate to inject multiple types
/// without the hassle of writing multiple trait bounds, which can be achieved by using the types
/// associated with this trait.
pub trait Ext {
/// The type for ifaces to schedule the next poll.
type ScheduleNextPoll: ScheduleNextPoll;
}