[−][src]Struct moore::source::Location
A single location within a source file, expressed as a byte offset.
Fields
source: Source
offset: usize
Implementations
impl Location
[src]
pub fn new(source: Source, offset: usize) -> Location
[src]
Create a new location.
pub fn iter(
self,
content: &'a Rc<dyn SourceContent + 'static>
) -> Box<dyn DoubleEndedIterator<Item = (usize, char)> + 'a, Global>
[src]
self,
content: &'a Rc<dyn SourceContent + 'static>
) -> Box<dyn DoubleEndedIterator<Item = (usize, char)> + 'a, Global>
Obtain an iterator into the source file at this location.
pub fn human(self) -> (usize, usize, usize)
[src]
Determine the line and column information at this location.
Returns a tuple (line, column, line_offset)
.
pub fn human_line(self) -> usize
[src]
Determine the line at this location.
pub fn human_column(self) -> usize
[src]
Determine the column at this location.
pub fn human_line_offset(self) -> usize
[src]
Determine the line offset at this location.
Trait Implementations
impl Clone for Location
[src]
impl Copy for Location
[src]
impl Debug for Location
[src]
impl Eq for Location
[src]
impl From<Location> for Span
[src]
impl Hash for Location
[src]
pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
__H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Location
[src]
pub fn cmp(&self, other: &Location) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Location> for Location
[src]
impl PartialOrd<Location> for Location
[src]
pub fn partial_cmp(&self, other: &Location) -> Option<Ordering>
[src]
pub fn lt(&self, other: &Location) -> bool
[src]
pub fn le(&self, other: &Location) -> bool
[src]
pub fn gt(&self, other: &Location) -> bool
[src]
pub fn ge(&self, other: &Location) -> bool
[src]
impl StructuralEq for Location
[src]
impl StructuralPartialEq for Location
[src]
Auto Trait Implementations
impl RefUnwindSafe for Location
[src]
impl Send for Location
[src]
impl Sync for Location
[src]
impl Unpin for Location
[src]
impl UnwindSafe for Location
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,