Struct code_location::CodeLocation
source · [−]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: u32
Trait Implementations
sourceimpl Clone for CodeLocation
impl Clone for CodeLocation
sourcefn clone(&self) -> CodeLocation
fn clone(&self) -> CodeLocation
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for CodeLocation
impl Debug for CodeLocation
sourceimpl Display for CodeLocation
impl Display for CodeLocation
sourceimpl Hash for CodeLocation
impl Hash for CodeLocation
sourceimpl Ord for CodeLocation
impl Ord for CodeLocation
sourceimpl PartialEq<CodeLocation> for CodeLocation
impl PartialEq<CodeLocation> for CodeLocation
sourcefn eq(&self, other: &CodeLocation) -> bool
fn eq(&self, other: &CodeLocation) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &CodeLocation) -> bool
fn ne(&self, other: &CodeLocation) -> bool
This method tests for !=
.
sourceimpl PartialOrd<CodeLocation> for CodeLocation
impl PartialOrd<CodeLocation> for CodeLocation
sourcefn partial_cmp(&self, other: &CodeLocation) -> Option<Ordering>
fn partial_cmp(&self, other: &CodeLocation) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for CodeLocation
impl Eq for CodeLocation
impl StructuralEq for CodeLocation
impl StructuralPartialEq for CodeLocation
Auto Trait Implementations
impl RefUnwindSafe for CodeLocation
impl Send for CodeLocation
impl Sync for CodeLocation
impl Unpin for CodeLocation
impl UnwindSafe for CodeLocation
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more