pub struct Origin {
pub function_name: String,
pub file: String,
pub line_number: u32,
pub hostname: String,
}Expand description
Callsite metadata attached to each payload.
use ray::Origin;
let origin = Origin::from_callsite(file!(), line!(), module_path!());
assert!(!origin.file.is_empty());Fields§
§function_name: String§file: String§line_number: u32§hostname: StringImplementations§
Source§impl Origin
impl Origin
Sourcepub fn from_callsite(file: &str, line_number: u32, module_path: &str) -> Self
pub fn from_callsite(file: &str, line_number: u32, module_path: &str) -> Self
Build origin metadata from a callsite.
Sourcepub fn from_callsite_with_options(
file: &str,
line_number: u32,
module_path: &str,
canonicalize_paths: bool,
) -> Self
pub fn from_callsite_with_options( file: &str, line_number: u32, module_path: &str, canonicalize_paths: bool, ) -> Self
Build origin metadata from a callsite with extra options.
Sourcepub fn from_callsite_with_base(
file: &str,
line_number: u32,
module_path: &str,
canonicalize_paths: bool,
base_dir: &Path,
) -> Self
pub fn from_callsite_with_base( file: &str, line_number: u32, module_path: &str, canonicalize_paths: bool, base_dir: &Path, ) -> Self
Build origin metadata from a callsite with an explicit base directory.
Sourcepub fn with_function_name(self, function_name: impl Into<String>) -> Self
pub fn with_function_name(self, function_name: impl Into<String>) -> Self
Override the function name.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Origin
impl RefUnwindSafe for Origin
impl Send for Origin
impl Sync for Origin
impl Unpin for Origin
impl UnwindSafe for Origin
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