Struct muse_lang::compiler::syntax::TrackedSource
source · pub struct TrackedSource {
pub name: String,
pub source: String,
/* private fields */
}Expand description
An entry in a Sources collection.
Fields§
§name: StringThe name of this source.
source: StringThe text of this source.
Implementations§
source§impl TrackedSource
impl TrackedSource
sourcepub fn offset_to_line(&self, offset: usize) -> (usize, usize)
pub fn offset_to_line(&self, offset: usize) -> (usize, usize)
Returns the line number and column of offset in this source.
If offset is out of bounds, this function returns the last line and
column relative to that line’s start.
Trait Implementations§
source§impl Clone for TrackedSource
impl Clone for TrackedSource
source§fn clone(&self) -> TrackedSource
fn clone(&self) -> TrackedSource
Returns a copy 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 TrackedSource
impl Debug for TrackedSource
source§impl PartialEq for TrackedSource
impl PartialEq for TrackedSource
impl Eq for TrackedSource
impl StructuralPartialEq for TrackedSource
Auto Trait Implementations§
impl Freeze for TrackedSource
impl RefUnwindSafe for TrackedSource
impl Send for TrackedSource
impl Sync for TrackedSource
impl Unpin for TrackedSource
impl UnwindSafe for TrackedSource
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
§impl<A> Cast for A
impl<A> Cast for A
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more