pub struct JoinPoint {
pub function_name: &'static str,
pub module_path: &'static str,
pub location: Location,
}Expand description
Information about a specific point in program execution.
A JoinPoint provides context about where an aspect is being applied,
including the function name, module path, and source location.
§Example
use aspect_core::prelude::*;
let jp = JoinPoint {
function_name: "process_data",
module_path: "my_app::data",
location: Location {
file: "src/data.rs",
line: 42,
},
};
println!("Executing: {} at {}:{}",
jp.function_name,
jp.location.file,
jp.location.line);Fields§
§function_name: &'static strThe name of the function being called
module_path: &'static strThe module path containing the function
location: LocationSource code location information
Implementations§
Source§impl JoinPoint
impl JoinPoint
Sourcepub fn new(
function_name: &'static str,
module_path: &'static str,
location: Location,
) -> Self
pub fn new( function_name: &'static str, module_path: &'static str, location: Location, ) -> Self
Creates a new JoinPoint.
§Example
use aspect_core::prelude::*;
let jp = JoinPoint::new(
"my_function",
"my::module",
Location { file: "src/lib.rs", line: 100 },
);Sourcepub fn qualified_name(&self) -> String
pub fn qualified_name(&self) -> String
Returns the fully qualified name of the function.
§Example
assert_eq!(jp.qualified_name(), "my::mod::func");Trait Implementations§
Auto Trait Implementations§
impl Freeze for JoinPoint
impl RefUnwindSafe for JoinPoint
impl Send for JoinPoint
impl Sync for JoinPoint
impl Unpin for JoinPoint
impl UnsafeUnpin for JoinPoint
impl UnwindSafe for JoinPoint
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more