()
| 138 | } |
| 139 | |
| 140 | pub fn custom_subprotocol() -> &'static Protocol { |
| 141 | static REGISTER_CUSTOM_SUBPROTOCOL: Once = ONCE_INIT; |
| 142 | |
| 143 | REGISTER_CUSTOM_SUBPROTOCOL.call_once(|| { |
| 144 | let super_proto = custom_protocol(); |
| 145 | let mut decl = ProtocolDecl::new("CustomSubProtocol").unwrap(); |
| 146 | |
| 147 | decl.add_protocol(super_proto); |
| 148 | decl.add_method_description::<(u32,), u32>(sel!(calculateFoo:), true); |
| 149 | |
| 150 | decl.register(); |
| 151 | }); |
| 152 | |
| 153 | Protocol::get("CustomSubProtocol").unwrap() |
| 154 | } |
| 155 | |
| 156 | pub fn custom_object() -> CustomObject { |
| 157 | CustomObject::new(custom_class()) |
no test coverage detected