fn hook_memcache_key_methods()

in src/plugin/plugin_memcache.rs [193:226]


    fn hook_memcache_key_methods(
        &self, class_name: Option<String>, function_name: String, style: ApiStyle,
    ) -> (Box<BeforeExecuteHook>, Box<AfterExecuteHook>) {
        (
            Box::new(move |request_id, execute_data| {
                let tag_info = MEMCACHE_KEY_METHOD_MAPPING
                    .get(&*get_tag_key(class_name.as_deref(), &function_name))
                    .unwrap();

                let key = style
                    .get_mut_parameter(execute_data, 0)
                    .as_z_str()
                    .and_then(|s| s.to_str().ok())
                    .map(ToOwned::to_owned)
                    .unwrap_or_default();

                let this = style.get_this_mut(execute_data)?;
                let peer = get_peer(this);

                let span = create_exit_span(
                    style,
                    request_id,
                    class_name.as_deref(),
                    &function_name,
                    &peer,
                    tag_info,
                    Some(&key),
                )?;

                Ok(Box::new(span))
            }),
            Box::new(after_hook),
        )
    }