pub(crate) fn from_method(
        item: &ItemTrait,
        method: &TraitItemMethod,
    ) -> TracersResult<ProbeSpecification> {
        if method.default != None {
            return Err(TracersError::invalid_provider(
                "Probe methods must NOT have a default implementation",
                method,
            ));
        } else if method.sig.constness != None
            || method.sig.unsafety != None
            || method.sig.asyncness != None
            || method.sig.abi != None
        {
            return Err(TracersError::invalid_provider(
                "Probe methods cannot be `const`, `unsafe`, `async`, or `extern \"C\"`",
                method,
            ));
        } else if method.sig.generics.type_params().next() != None {
            return Err(TracersError::invalid_provider(
            "Probe methods must not take any type parameters; generics are not supported in probes",
            method,
        ));
        } else if method.sig.variadic != None {
            return Err(TracersError::invalid_provider(
                "Probe methods cannot have variadic arguments",
                method,
            ));
        } else if method.sig.output != ReturnType::Default {
            return Err(TracersError::invalid_provider(
                "Probe methods must not have an explicit return type (they return `()` implicitly)",
                method,
            ));
        };

        let first_arg = method.sig.inputs.iter().next();
        if let Some(FnArg::Receiver(_)) = first_arg {
            return Err(TracersError::invalid_provider(
                "Probe methods must not have any `&self` or `self` args",
                method,
            ));
        }

        let mut args: Vec<ProbeArgSpecification> = Vec::new();
        for (idx, arg) in method.sig.inputs.iter().enumerate() {
            args.push(ProbeArgSpecification::from_fnarg(method, idx, arg)?);
        }

        let spec = ProbeSpecification {
            name: method.sig.ident.to_string(),
            method_name: method.sig.ident.clone(),
            original_method: method.clone(),
            vis: item.vis.clone(),
            span: method.span(),
            args,
        };

        Ok(spec)
    }
/// Given a trait method, compute the probe that corresponds to that method.
/// If the method isn't suitable for use as a probe method, returns an error
///
/// Probe methods must have the following qualities:
/// * Must be static; no `&self` or `&mut self` or `self` first argument
/// * Zero or more arguments after that; each argument must be a type that is supported by the
/// probe infrastructure (Note this requirement is enforced by the compiler not by this function)
/// * Return type of `()`
/// * No default implementation
/// * Not `unsafe`, `const`, `async`, or `extern "C"`
/// * No type parameters; generics are not supported in probe types
/// * Not variadic
Given a trait method, compute the probe that corresponds to that method.
If the method isn't suitable for use as a probe method, returns an error


Given a trait method compute the probe that corresponds to that method . If the method isn ' t suitable for use as a probe method returns an error
pub(crate) fn from_method(
        item: &ItemTrait,
        method: &TraitItemMethod,
    ) -> TracersResult<ProbeSpecification> {
        if method.default != None {
            return Err(TracersError::invalid_provider(
                "Probe methods must NOT have a default implementation",
                method,
            ));
        } else if method.sig.constness != None
            || method.sig.unsafety != None
            || method.sig.asyncness != None
            || method.sig.abi != None
        {
            return Err(TracersError::invalid_provider(
                "Probe methods cannot be `const`, `unsafe`, `async`, or `extern \"C\"`",
                method,
            ));
        } else if method.sig.generics.type_params().next() != None {
            return Err(TracersError::invalid_provider(
            "Probe methods must not take any type parameters; generics are not supported in probes",
            method,
        ));
        } else if method.sig.variadic != None {
            return Err(TracersError::invalid_provider(
                "Probe methods cannot have variadic arguments",
                method,
            ));
        } else if method.sig.output != ReturnType::Default {
            return Err(TracersError::invalid_provider(
                "Probe methods must not have an explicit return type (they return `()` implicitly)",
                method,
            ));
        };
        let first_arg = method.sig.inputs.iter().next();
        if let Some(FnArg::Receiver(_)) = first_arg {
            return Err(TracersError::invalid_provider(
                "Probe methods must not have any `&self` or `self` args",
                method,
            ));
        }
        let mut args: Vec<ProbeArgSpecification> = Vec::new();
        for (idx, arg) in method.sig.inputs.iter().enumerate() {
            args.push(ProbeArgSpecification::from_fnarg(method, idx, arg)?);
        }
        let spec = ProbeSpecification {
            name: method.sig.ident.to_string(),
            method_name: method.sig.ident.clone(),
            original_method: method.clone(),
            vis: item.vis.clone(),
            span: method.span(),
            args,
        };
        Ok(spec)
    }
pub ( crate ) fn from_method ( item : & ItemTrait , method : & TraitItemMethod , ) -> TracersResult < ProbeSpecification > { if method . default != None { return Err ( TracersError :: invalid_provider ( " " , method , ) ) ; } else if method . sig . constness != None || method . sig . unsafety != None || method . sig . asyncness != None || method . sig . abi != None { return Err ( TracersError :: invalid_provider ( " \" \" " , method , ) ) ; } else if method . sig . generics . type_params ( ) . next ( ) != None { return Err ( TracersError :: invalid_provider ( " " , method , ) ) ; } else if method . sig . variadic != None { return Err ( TracersError :: invalid_provider ( " " , method , ) ) ; } else if method . sig . output != ReturnType :: Default { return Err ( TracersError :: invalid_provider ( " " , method , ) ) ; } ; let first_arg = method . sig . inputs . iter ( ) . next ( ) ; if let Some ( FnArg :: Receiver ( _ ) ) = first_arg { return Err ( TracersError :: invalid_provider ( " " , method , ) ) ; } let mut args : Vec < ProbeArgSpecification > = Vec :: new ( ) ; for ( idx , arg ) in method . sig . inputs . iter ( ) . enumerate ( ) { args . push ( ProbeArgSpecification :: from_fnarg ( method , idx , arg ) ? ) ; } let spec = ProbeSpecification { name : method . sig . ident . to_string ( ) , method_name : method . sig . ident . clone ( ) , original_method : method . clone ( ) , vis : item . vis . clone ( ) , span : method . span ( ) , args , } ; Ok ( spec ) }
Given a trait method, compute the probe that corresponds to that method.
Given a trait method compute the probe that corresponds to that method .
item
&ItemTrait
method
&TraitItemMethod
item
&ItemTrait
method
&TraitItemMethod