pub struct Module { /* private fields */ }
Expand description
Corresponds the grammar rule module
.
Implementations§
Source§impl Module
impl Module
pub fn empty(name: Identifier) -> Self
pub fn new(name: Identifier, body: ModuleBody) -> Self
pub fn with_source_file(self, source_file: PathBuf) -> Self
pub fn with_base_uri(self, base_uri: Url) -> Self
pub fn with_version_info<S>(self, version_info: S) -> Self
pub fn with_version_uri(self, version_uri: Url) -> Self
pub const fn has_source_file(&self) -> bool
pub const fn source_file(&self) -> Option<&PathBuf>
pub fn set_source_file(&mut self, source_file: PathBuf)
pub fn unset_source_file(&mut self)
pub const fn has_base_uri(&self) -> bool
pub const fn base_uri(&self) -> Option<&HeaderValue<Url>>
pub fn set_base_uri(&mut self, base_uri: HeaderValue<Url>)
pub fn unset_base_uri(&mut self)
pub const fn has_version_info(&self) -> bool
pub const fn version_info(&self) -> Option<&HeaderValue<String>>
pub fn set_version_info(&mut self, version_info: HeaderValue<String>)
pub fn unset_version_info(&mut self)
pub const fn has_version_uri(&self) -> bool
pub const fn version_uri(&self) -> Option<&HeaderValue<Url>>
pub fn set_version_uri(&mut self, version_uri: HeaderValue<Url>)
pub fn unset_version_uri(&mut self)
pub const fn has_file_id(&self) -> bool
pub const fn file_id(&self) -> Option<&FileId>
pub fn set_file_id(&mut self, file_id: FileId)
pub fn unset_file_id(&mut self)
pub fn imported_modules(&self) -> HashSet<&Identifier>
pub fn imported_module_versions( &self, ) -> HashMap<&Identifier, Option<&HeaderValue<Url>>>
pub fn imported_types(&self) -> HashSet<&QualifiedIdentifier>
pub fn defined_names(&self) -> HashSet<&Identifier>
pub fn is_incomplete(&self, cache: &InMemoryModuleCache) -> bool
Sourcepub fn validate(
&self,
cache: &InMemoryModuleCache,
loader: &impl ModuleLoader,
check_constraints: bool,
)
pub fn validate( &self, cache: &InMemoryModuleCache, loader: &impl ModuleLoader, check_constraints: bool, )
§Checks
- name is valid
Identifier
- base URI is absolute
Url
- version info string is not empty (warning)
- version URI is absolute
Url
- body is valid
pub fn is_library_module(&self) -> bool
pub fn resolve_local(&self, name: &Identifier) -> Option<&Definition>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Module
impl<'de> Deserialize<'de> for Module
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl HasBody for Module
impl HasBody for Module
Source§impl HasName for Module
impl HasName for Module
Source§fn name(&self) -> &Identifier
fn name(&self) -> &Identifier
Get the name of the enclosing type.
Source§fn set_name(&mut self, name: Identifier)
fn set_name(&mut self, name: Identifier)
Set the name of the enclosing type.
Source§impl HasSourceSpan for Module
impl HasSourceSpan for Module
fn with_source_span(self, span: Span) -> Self
fn source_span(&self) -> Option<&Span>
fn set_source_span(&mut self, span: Span)
fn unset_source_span(&mut self)
fn has_source_span(&self) -> bool
Source§impl References for Module
impl References for Module
fn referenced_types<'a>(&'a self, names: &mut HashSet<&'a IdentifierReference>)
fn referenced_annotations<'a>( &'a self, names: &mut HashSet<&'a IdentifierReference>, )
Auto Trait Implementations§
impl Freeze for Module
impl RefUnwindSafe for Module
impl Send for Module
impl Sync for Module
impl Unpin for Module
impl UnwindSafe for Module
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