pub struct Source<'a> {
pub file: &'a str,
pub text: &'a str,
pub export_as: Option<&'a str>,
}Expand description
One of the sources a program is compiled from: the file it is named
by in diagnostics, its text, and the name its own export is linked
under when another source’s export is the program’s.
Fields§
§file: &'a str§text: &'a str§export_as: Option<&'a str>When set, this source’s export is defined under this name in the
linked namespace, and every mention of export in this source
names it, so that the program’s export, in another source, can
call it: a host composes a program’s output into a format’s render
by linking the program as program-export and writing
def export [input] (yaml-render (program-export input)). The
source must define export (no_export otherwise) and must not
mention the name already (duplicate_def), since renaming beside
a binding of that name would change what the source means.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'a> Forget for Source<'a>
impl<'a> Freeze for Source<'a>
impl<'a> RefUnwindSafe for Source<'a>
impl<'a> Send for Source<'a>
impl<'a> Sync for Source<'a>
impl<'a> Unpin for Source<'a>
impl<'a> UnsafeUnpin for Source<'a>
impl<'a> UnwindSafe for Source<'a>
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