pub struct SourceLocation {
pub line: u32,
pub column: u32,
pub url: Option<Url>,
}Expand description
源代码位置,包含文件 URL 和位置信息
该结构体扩展了 SourcePosition,增加了文件 URL 信息, 可以表示代码在特定文件中的位置。
Fields§
§line: u32行号,从 1 开始计数
表示当前位置所在的行号。
column: u32列号,从 1 开始计数
表示当前位置所在的列号。
url: Option<Url>源文件的 URL,可选
如果存在,表示包含该代码的文件的 URL 或路径。 可以是文件系统路径或网络 URL。
Trait Implementations§
Source§impl Clone for SourceLocation
impl Clone for SourceLocation
Source§fn clone(&self) -> SourceLocation
fn clone(&self) -> SourceLocation
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 SourceLocation
impl Debug for SourceLocation
Source§impl Default for SourceLocation
impl Default for SourceLocation
Source§impl<'de> Deserialize<'de> for SourceLocation
impl<'de> Deserialize<'de> for SourceLocation
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
Auto Trait Implementations§
impl Freeze for SourceLocation
impl RefUnwindSafe for SourceLocation
impl Send for SourceLocation
impl Sync for SourceLocation
impl Unpin for SourceLocation
impl UnwindSafe for SourceLocation
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