pub struct CodeLocation {
pub file: &'static str,
pub line: u32,
pub column: u32,
}Expand description
A CodeLocation type to represent a certain point in a source code text file.
§Examples
use code_location::{code_location, CodeLocation};
let code_location: CodeLocation = code_location!();
assert_eq!(code_location.to_string(), "src/lib.rs:6:35");
assert_eq!(code_location.file, "src/lib.rs");
assert_eq!(code_location.line, 6);
assert_eq!(code_location.column, 35);Fields§
§file: &'static str§line: u32§column: u32Trait Implementations§
Source§impl Clone for CodeLocation
impl Clone for CodeLocation
Source§fn clone(&self) -> CodeLocation
fn clone(&self) -> CodeLocation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CodeLocation
impl Debug for CodeLocation
Source§impl Display for CodeLocation
impl Display for CodeLocation
Source§impl Hash for CodeLocation
impl Hash for CodeLocation
Source§impl Ord for CodeLocation
impl Ord for CodeLocation
Source§fn cmp(&self, other: &CodeLocation) -> Ordering
fn cmp(&self, other: &CodeLocation) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for CodeLocation
impl PartialEq for CodeLocation
Source§impl PartialOrd for CodeLocation
impl PartialOrd for CodeLocation
impl Copy for CodeLocation
impl Eq for CodeLocation
impl StructuralPartialEq for CodeLocation
Auto Trait Implementations§
impl Freeze for CodeLocation
impl RefUnwindSafe for CodeLocation
impl Send for CodeLocation
impl Sync for CodeLocation
impl Unpin for CodeLocation
impl UnwindSafe for CodeLocation
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