pub struct Source(/* private fields */);
Implementations§
Source§impl Source
impl Source
pub fn from_file(path: impl Into<PathBuf>, text: String) -> Self
pub fn from_string(name: &str, text: String) -> Self
pub fn new(file_id: FileId, text: String) -> Self
pub fn id(&self) -> FileId
pub fn text(&self) -> &str
pub fn span_text(&self, span: Span) -> Option<&str>
pub fn nodes(&self) -> &[SyntaxNode]
pub fn line_starts(&self) -> &[usize]
pub fn append(&mut self, text: &str)
pub fn warnings(&self) -> Vec<SyntaxError>
pub fn find(&self, span: Span) -> Option<LinkedNode<'_>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Source
impl RefUnwindSafe for Source
impl Send for Source
impl Sync for Source
impl Unpin for Source
impl UnwindSafe for Source
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