pub struct ModuleSource { /* private fields */ }Expand description
Host-supplied source returned by a ServiceModuleResolver.
Implementations§
Source§impl ModuleSource
impl ModuleSource
Sourcepub fn new(identity: impl Into<String>, source: impl AsRef<[u8]>) -> Self
pub fn new(identity: impl Into<String>, source: impl AsRef<[u8]>) -> Self
Creates a module whose diagnostic and resolver-referrer source name matches its canonical cache identity.
Sourcepub fn with_source_name(
identity: impl Into<String>,
source_name: impl Into<String>,
source: impl AsRef<[u8]>,
) -> Self
pub fn with_source_name( identity: impl Into<String>, source_name: impl Into<String>, source: impl AsRef<[u8]>, ) -> Self
Creates a module with a separate canonical cache identity and source
name. The source name is used for diagnostics and nested require
resolver referrers.
pub fn identity(&self) -> &str
pub fn source_name(&self) -> &str
pub fn source(&self) -> &[u8] ⓘ
Trait Implementations§
Source§impl Clone for ModuleSource
impl Clone for ModuleSource
Source§fn clone(&self) -> ModuleSource
fn clone(&self) -> ModuleSource
Returns a duplicate 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 ModuleSource
impl Debug for ModuleSource
Source§impl PartialEq for ModuleSource
impl PartialEq for ModuleSource
impl Eq for ModuleSource
impl StructuralPartialEq for ModuleSource
Auto Trait Implementations§
impl Freeze for ModuleSource
impl RefUnwindSafe for ModuleSource
impl Send for ModuleSource
impl Sync for ModuleSource
impl Unpin for ModuleSource
impl UnsafeUnpin for ModuleSource
impl UnwindSafe for ModuleSource
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