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

Method add_method_description_common

src/declare.rs:268–284  ·  view source on GitHub ↗
(&mut self, sel: Sel, is_required: bool,
            is_instance_method: bool)

Source from the content-addressed store, hash-verified

266 }
267
268 fn add_method_description_common<Args, Ret>(&mut self, sel: Sel, is_required: bool,
269 is_instance_method: bool)
270 where Args: EncodeArguments,
271 Ret: Encode {
272 let encs = Args::encodings();
273 let encs = encs.as_ref();
274 let sel_args = count_args(sel);
275 assert!(sel_args == encs.len(),
276 "Selector accepts {} arguments, but function accepts {}",
277 sel_args, encs.len(),
278 );
279 let types = method_type_encoding(&Ret::encode(), encs);
280 unsafe {
281 runtime::protocol_addMethodDescription(
282 self.proto, sel, types.as_ptr(), is_required as BOOL, is_instance_method as BOOL);
283 }
284 }
285
286 /// Adds an instance method declaration with a given description to self.
287 pub fn add_method_description<Args, Ret>(&mut self, sel: Sel, is_required: bool)

Callers

nothing calls this directly

Calls 3

count_argsFunction · 0.85
method_type_encodingFunction · 0.85
as_ptrMethod · 0.80

Tested by

no test coverage detected