pub struct SourceRegistry { /* private fields */ }Expand description
Implementations§
Source§impl SourceRegistry
impl SourceRegistry
Sourcepub fn insert(
&mut self,
source: SourceId,
bytes: Arc<[u8]>,
) -> Option<Arc<[u8]>>
pub fn insert( &mut self, source: SourceId, bytes: Arc<[u8]>, ) -> Option<Arc<[u8]>>
Inserts source bytes, returning any previous bytes for the same id.
Sourcepub fn intern_bytes(&mut self, source: SourceId, bytes: impl Into<Arc<[u8]>>)
pub fn intern_bytes(&mut self, source: SourceId, bytes: impl Into<Arc<[u8]>>)
Interns raw bytes under source, replacing any prior entry.
Sourcepub fn intern_text(&mut self, source: SourceId, text: &str)
pub fn intern_text(&mut self, source: SourceId, text: &str)
Interns text under source as its UTF-8 bytes.
Sourcepub fn intern_span(&mut self, origin: &Origin, bytes: &[u8])
pub fn intern_span(&mut self, origin: &Origin, bytes: &[u8])
Splices bytes into the stored source at the origin’s span.
Trait Implementations§
Source§impl Clone for SourceRegistry
impl Clone for SourceRegistry
Source§fn clone(&self) -> SourceRegistry
fn clone(&self) -> SourceRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SourceRegistry
impl Debug for SourceRegistry
Source§impl Default for SourceRegistry
impl Default for SourceRegistry
Source§fn default() -> SourceRegistry
fn default() -> SourceRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SourceRegistry
impl RefUnwindSafe for SourceRegistry
impl Send for SourceRegistry
impl Sync for SourceRegistry
impl Unpin for SourceRegistry
impl UnsafeUnpin for SourceRegistry
impl UnwindSafe for SourceRegistry
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