fn find_probes(item: &ItemTrait) -> TracersResult<Vec<ProbeSpecification>> {
    if item.generics.type_params().next() != None || item.generics.lifetimes().next() != None {
        return Err(TracersError::invalid_provider(
            "Probe traits must not take any lifetime or type parameters",
            item,
        ));
    }

    // Look at the methods on the trait and translate each one into a probe specification
    let mut specs: Vec<ProbeSpecification> = Vec::new();
    for f in item.items.iter() {
        match f {
            TraitItem::Method(ref m) => {
                specs.push(ProbeSpecification::from_method(item, m)?);
            }
            _ => {
                return Err(TracersError::invalid_provider(
                    "Probe traits must consist entirely of methods, no other contents",
                    f,
                ));
            }
        }
    }

    Ok(specs)
}
/// Looking at the methods defined on the trait, deduce from those methods the probes that we will
/// need to define, including their arg counts and arg types.
///
/// If the trait contains anything other than method declarations, or any of the declarations are
/// not suitable as probes, an error is returned
Looking at the methods defined on the trait, deduce from those methods the probes that we will
need to define, including their arg counts and arg types.

If the trait contains anything other than method declarations, or any of the declarations are
not suitable as probes, an error is returned
Looking at the methods defined on the trait deduce from those methods the probes that we will need to define including their arg counts and arg types . If the trait contains anything other than method declarations or any of the declarations are not suitable as probes an error is returned
fn find_probes(item: &ItemTrait) -> TracersResult<Vec<ProbeSpecification>> {
    if item.generics.type_params().next() != None || item.generics.lifetimes().next() != None {
        return Err(TracersError::invalid_provider(
            "Probe traits must not take any lifetime or type parameters",
            item,
        ));
    }
    // Look at the methods on the trait and translate each one into a probe specification
    let mut specs: Vec<ProbeSpecification> = Vec::new();
    for f in item.items.iter() {
        match f {
            TraitItem::Method(ref m) => {
                specs.push(ProbeSpecification::from_method(item, m)?);
            }
            _ => {
                return Err(TracersError::invalid_provider(
                    "Probe traits must consist entirely of methods, no other contents",
                    f,
                ));
            }
        }
    }
    Ok(specs)
}
fn find_probes ( item : & ItemTrait ) -> TracersResult < Vec < ProbeSpecification > > { if item . generics . type_params ( ) . next ( ) != None || item . generics . lifetimes ( ) . next ( ) != None { return Err ( TracersError :: invalid_provider ( " " , item , ) ) ; } // Look at the methods on the trait and translate each one into a probe specification let mut specs : Vec < ProbeSpecification > = Vec :: new ( ) ; for f in item . items . iter ( ) { match f { TraitItem :: Method ( ref m ) => { specs . push ( ProbeSpecification :: from_method ( item , m ) ? ) ; } _ => { return Err ( TracersError :: invalid_provider ( " " , f , ) ) ; } } } Ok ( specs ) }
Looking at the methods defined on the trait, deduce from those methods the probes that we will
need to define, including their arg counts and arg types.
Looking at the methods defined on the trait deduce from those methods the probes that we will need to define including their arg counts and arg types .
item
&ItemTrait
item
&ItemTrait