Diffstat (limited to 'src/protocol.rs')
| -rw-r--r-- | src/protocol.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/protocol.rs b/src/protocol.rs index acd22b8..238dd5e 100644 --- a/src/protocol.rs +++ b/src/protocol.rs @@ -1,11 +1,13 @@ -//! # Design +//! Interface for interfaces. +//! +//! ## Design //! The design of protocols is based on an idea found in the [`gdbstub`](https://docs.rs/gdbstub/latest/gdbstub/target/ext/index.html) crate. //! This idea is of so called inlinable dyn extension traits. //! However, in the form given in `gdbstub` they can't be used for arbitrary interfaces. //! The main trait still needs to know about all the possible protocols. //! That is where this module comes in. //! -//! This module implements a technique we name dynamic inlinable dyn extension traits (DIDETs). +//! This module implements a technique we name dynamic inlinable dyn extension traits (DIDETs). //! DIDETs adds one more layer to IDETs. Instead of a trait that knows all the possible protocols, //! we have a single trait [`Implementer`] that allows looking up an extension trait //! using a type ID. This may seem like it defeats the purpose of IDETs, that being to @@ -70,7 +72,7 @@ pub trait Implementer<'ctx> { /// The returned [`AnyImpl`] could be for a different protocol; This is considered /// a bug in an implementation and can be resolved via a panic. This is how /// [`ImplementerExt::interface_for`] behaves. - /// + /// /// If `self` doesn't implement the given protocol, then a `None` is returned. fn interface(&mut self, id: ProtocolId) -> Option<AnyImpl<'_, 'ctx>>; } |