mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-23 09:23:25 +00:00
Make Ext
a trait
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
20ee05e8e0
commit
fa76afb3a9
16
kernel/libs/aster-bigtcp/src/ext.rs
Normal file
16
kernel/libs/aster-bigtcp/src/ext.rs
Normal 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;
|
||||
}
|
Reference in New Issue
Block a user