[][src]Attribute Macro racetrack_proc_macro::track_with

#[track_with]

Track the target with the tracker specified in the arguments. Requires one argument containing the path to the tracker.

Arguments

  • tracked_path - The path to the tracker. This must be the first unnamed argument. Required.
  • exclude - A comma separated list of methods to exclude. This only does something on impl blocks.
  • include_receiver - Include the receiver (self). If false, the tracker must be available in the scope of the relevant method. If no receiver was found and this is true, the method will be skipped. Defaults to true.
  • namespace - Override the namespace of the tracked item. Tracked key will be namespace::function_name. Defaults to the struct name for impl blocks, None for functions and closures.

Example

use racetrack::{Tracker, track_with};

struct TrackedStruct(Arc<Tracker>);

#[track_with(0, namespace = "Tracked")]
impl TrackedStruct {
    fn tracked_fn(&self, arg: String) {}
}