Struct diagnostic_quick::error_3rd::NodeLocation
source · pub struct NodeLocation<T> {
pub value: T,
pub range: Range<usize>,
pub file: FileID,
}Expand description
Represents an AST object with position
Fields§
§value: TThe actual value
range: Range<usize>The Start offset and end offset
file: FileIDAbsolute path to the file where the node resides
Implementations§
source§impl<T> NodeLocation<T>
impl<T> NodeLocation<T>
pub fn new(value: T, range: &Range<usize>, file: &FileID) -> Self
pub fn with_range(self, range: &Range<usize>) -> Self
pub fn with_file(self, file: &FileID) -> Self
pub fn map<U>(self, f: impl FnOnce(T) -> U) -> NodeLocation<U>
pub fn eq_strict(&self, other: &Self) -> boolwhere T: PartialEq,
Trait Implementations§
source§impl<T: Clone> Clone for NodeLocation<T>
impl<T: Clone> Clone for NodeLocation<T>
source§fn clone(&self) -> NodeLocation<T>
fn clone(&self) -> NodeLocation<T>
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<T: Debug> Debug for NodeLocation<T>
impl<T: Debug> Debug for NodeLocation<T>
source§impl<T> Deref for NodeLocation<T>
impl<T> Deref for NodeLocation<T>
source§impl<T> DerefMut for NodeLocation<T>
impl<T> DerefMut for NodeLocation<T>
source§impl<'de, T> Deserialize<'de> for NodeLocation<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for NodeLocation<T>where T: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<T> From<T> for NodeLocation<T>
impl<T> From<T> for NodeLocation<T>
source§impl<T> Hash for NodeLocation<T>where
T: Hash,
impl<T> Hash for NodeLocation<T>where T: Hash,
source§impl<T> PartialEq<NodeLocation<T>> for NodeLocation<T>where
T: Eq,
impl<T> PartialEq<NodeLocation<T>> for NodeLocation<T>where T: Eq,
source§impl<T> Serialize for NodeLocation<T>where
T: Serialize,
impl<T> Serialize for NodeLocation<T>where T: Serialize,
impl<T> Eq for NodeLocation<T>where T: Eq,
Auto Trait Implementations§
impl<T> RefUnwindSafe for NodeLocation<T>where T: RefUnwindSafe,
impl<T> Send for NodeLocation<T>where T: Send,
impl<T> Sync for NodeLocation<T>where T: Sync,
impl<T> Unpin for NodeLocation<T>where T: Unpin,
impl<T> UnwindSafe for NodeLocation<T>where T: UnwindSafe,
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.