rune/runtime/
protocol.rs
1use crate::alloc;
2#[cfg(feature = "doc")]
3use crate::alloc::Vec;
4use crate::compile::meta;
5use crate::function_meta::{AssociatedName, ToInstance};
6use crate::Hash;
7
8#[doc(inline)]
9pub use rune_core::protocol::Protocol;
10
11impl ToInstance for &'static Protocol {
12 #[inline]
13 fn to_instance(self) -> alloc::Result<AssociatedName> {
14 Ok(AssociatedName {
15 kind: meta::AssociatedKind::Protocol(self),
16 function_parameters: Hash::EMPTY,
17 #[cfg(feature = "doc")]
18 parameter_types: Vec::new(),
19 })
20 }
21}