pub struct SourceManager { /* private fields */ }Expand description
A manager for sources, which stores sources and provides methods to insert and retrieve them.
Implementations§
Source§impl SourceManager
impl SourceManager
Sourcepub fn new(interner: ThreadedInterner) -> Self
pub fn new(interner: ThreadedInterner) -> Self
Sourcepub fn insert_path(
&self,
name: String,
path: PathBuf,
category: SourceCategory,
) -> SourceIdentifier
pub fn insert_path( &self, name: String, path: PathBuf, category: SourceCategory, ) -> SourceIdentifier
Sourcepub fn insert_content(
&self,
name: String,
content: String,
category: SourceCategory,
) -> SourceIdentifier
pub fn insert_content( &self, name: String, content: String, category: SourceCategory, ) -> SourceIdentifier
Sourcepub fn contains(&self, source_id: &SourceIdentifier) -> bool
pub fn contains(&self, source_id: &SourceIdentifier) -> bool
Sourcepub fn source_ids(&self) -> impl Iterator<Item = SourceIdentifier> + '_
pub fn source_ids(&self) -> impl Iterator<Item = SourceIdentifier> + '_
Retrieve an iterator over all source identifiers in the manager.
Sourcepub fn source_ids_for_category(
&self,
category: SourceCategory,
) -> impl Iterator<Item = SourceIdentifier> + '_
pub fn source_ids_for_category( &self, category: SourceCategory, ) -> impl Iterator<Item = SourceIdentifier> + '_
Retrieve an iterator over all source identifiers in the manager for the given category.
Sourcepub fn source_ids_except_category(
&self,
category: SourceCategory,
) -> impl Iterator<Item = SourceIdentifier> + '_
pub fn source_ids_except_category( &self, category: SourceCategory, ) -> impl Iterator<Item = SourceIdentifier> + '_
Retrieve an iterator over all source identifiers in the manager for categories other than the given category.
Sourcepub fn load(&self, source_id: &SourceIdentifier) -> Result<Source, SourceError>
pub fn load(&self, source_id: &SourceIdentifier) -> Result<Source, SourceError>
pub fn write( &self, source_id: SourceIdentifier, content: String, ) -> Result<(), SourceError>
Trait Implementations§
Source§impl Clone for SourceManager
impl Clone for SourceManager
Source§fn clone(&self) -> SourceManager
fn clone(&self) -> SourceManager
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 Debug for SourceManager
impl Debug for SourceManager
impl Send for SourceManager
impl Sync for SourceManager
Auto Trait Implementations§
impl Freeze for SourceManager
impl !RefUnwindSafe for SourceManager
impl Unpin for SourceManager
impl !UnwindSafe for SourceManager
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