MCPcopy Create free account
hub / github.com/SSheldon/rust-objc / custom_protocol

Function custom_protocol

src/test_utils.rs:124–138  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

122}
123
124pub 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
140pub fn custom_subprotocol() -> &'static Protocol {
141 static REGISTER_CUSTOM_SUBPROTOCOL: Once = ONCE_INIT;

Callers 5

test_protocolFunction · 0.85
test_subprotocolsFunction · 0.85
test_protocolsFunction · 0.85
custom_classFunction · 0.85
custom_subprotocolFunction · 0.85

Calls 1

registerMethod · 0.45

Tested by

no test coverage detected