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

Function custom_subprotocol

src/test_utils.rs:140–154  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

138}
139
140pub 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
156pub fn custom_object() -> CustomObject {
157 CustomObject::new(custom_class())

Callers 1

test_subprotocolsFunction · 0.85

Calls 3

custom_protocolFunction · 0.85
add_protocolMethod · 0.80
registerMethod · 0.45

Tested by

no test coverage detected