[−][src]Struct codespan_reporting::files::SimpleFile
A file database that contains a single source file.
Because there is only single file in this database we use ()
as a FileId
.
This is useful for simple language tests, but it might be worth creating a custom implementation when a language scales beyond a certain size.
Implementations
impl<Name, Source> SimpleFile<Name, Source> where
Name: Display,
Source: AsRef<str>,
[src][−]
Name: Display,
Source: AsRef<str>,
pub fn new(name: Name, source: Source) -> SimpleFile<Name, Source>
[src][−]
Create a new source file.
pub fn name(&self) -> &Name
[src][−]
Return the name of the file.
pub fn source(&self) -> &Source
[src][−]
Return the source of the file.
Trait Implementations
impl<Name: Clone, Source: Clone> Clone for SimpleFile<Name, Source>
[src][+]
impl<Name: Debug, Source: Debug> Debug for SimpleFile<Name, Source>
[src][+]
impl<'a, Name, Source> Files<'a> for SimpleFile<Name, Source> where
Name: 'a + Display + Clone,
Source: 'a + AsRef<str>,
[src][+]
Name: 'a + Display + Clone,
Source: 'a + AsRef<str>,
Auto Trait Implementations
impl<Name, Source> RefUnwindSafe for SimpleFile<Name, Source> where
Name: RefUnwindSafe,
Source: RefUnwindSafe,
Name: RefUnwindSafe,
Source: RefUnwindSafe,
impl<Name, Source> Send for SimpleFile<Name, Source> where
Name: Send,
Source: Send,
Name: Send,
Source: Send,
impl<Name, Source> Sync for SimpleFile<Name, Source> where
Name: Sync,
Source: Sync,
Name: Sync,
Source: Sync,
impl<Name, Source> Unpin for SimpleFile<Name, Source> where
Name: Unpin,
Source: Unpin,
Name: Unpin,
Source: Unpin,
impl<Name, Source> UnwindSafe for SimpleFile<Name, Source> where
Name: UnwindSafe,
Source: UnwindSafe,
Name: UnwindSafe,
Source: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,