pub struct SourceCandidate { /* private fields */ }Expand description
A physical source document advertised as a candidate for a module name.
Its provider-scoped CandidateId, physical SourceOrigin, display
label, and immutable bytes are independent. In particular, custom and
in-memory sources do not need to invent filesystem paths.
Implementations§
Source§impl SourceCandidate
impl SourceCandidate
Sourcepub fn new(
identity: impl Into<CandidateId>,
origin: SourceOrigin,
label: impl Into<Arc<str>>,
bytes: impl Into<Arc<[u8]>>,
) -> Self
pub fn new( identity: impl Into<CandidateId>, origin: SourceOrigin, label: impl Into<Arc<str>>, bytes: impl Into<Arc<[u8]>>, ) -> Self
Create a source candidate.
Sourcepub fn identity(&self) -> &CandidateId
pub fn identity(&self) -> &CandidateId
Return this candidate’s stable identity within its provider.
Sourcepub fn origin(&self) -> &SourceOrigin
pub fn origin(&self) -> &SourceOrigin
Return the physical origin of the document.
Return the shared allocation containing the immutable source bytes.
Trait Implementations§
Source§impl Clone for SourceCandidate
impl Clone for SourceCandidate
Source§fn clone(&self) -> SourceCandidate
fn clone(&self) -> SourceCandidate
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 moreAuto Trait Implementations§
impl Freeze for SourceCandidate
impl RefUnwindSafe for SourceCandidate
impl Send for SourceCandidate
impl Sync for SourceCandidate
impl Unpin for SourceCandidate
impl UnsafeUnpin for SourceCandidate
impl UnwindSafe for SourceCandidate
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