()
| 122 | } |
| 123 | |
| 124 | pub fn custom_protocol() -> &'static Protocol { |
| 125 | static REGISTER_CUSTOM_PROTOCOL: Once = ONCE_INIT; |
| 126 | |
| 127 | REGISTER_CUSTOM_PROTOCOL.call_once(|| { |
| 128 | let mut decl = ProtocolDecl::new("CustomProtocol").unwrap(); |
| 129 | |
| 130 | decl.add_method_description::<(i32,), ()>(sel!(setBar:), true); |
| 131 | decl.add_method_description::<(), *const c_char>(sel!(getName), false); |
| 132 | decl.add_class_method_description::<(i32, i32), i32>(sel!(addNumber:toNumber:), true); |
| 133 | |
| 134 | decl.register(); |
| 135 | }); |
| 136 | |
| 137 | Protocol::get("CustomProtocol").unwrap() |
| 138 | } |
| 139 | |
| 140 | pub fn custom_subprotocol() -> &'static Protocol { |
| 141 | static REGISTER_CUSTOM_SUBPROTOCOL: Once = ONCE_INIT; |
no test coverage detected