pub struct Module { /* private fields */ }
Expand description
Corresponds the grammar rule module
.
Implementations§
Source§impl Module
impl Module
pub fn new(name: Identifier) -> Self
pub fn with_source_file(self, source_file: PathBuf) -> 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_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 with_base_uri(self, base_uri: Url) -> 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 fn with_version_info<S>(self, version_info: S) -> 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 fn with_version_uri(self, version_uri: Url) -> 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 fn with_imports<I>(self, import_statements: I) -> Selfwhere
I: IntoIterator<Item = ImportStatement>,
pub fn has_imports(&self) -> bool
pub fn imports_len(&self) -> usize
pub fn imports(&self) -> impl Iterator<Item = &ImportStatement>
pub fn imports_mut(&mut self) -> impl Iterator<Item = &mut ImportStatement>
pub fn add_to_imports<I>(&mut self, value: I)where
I: Into<ImportStatement>,
pub fn extend_imports<I>(&mut self, extension: I)where
I: IntoIterator<Item = ImportStatement>,
pub fn with_definitions<I>(self, definitions: I) -> Selfwhere
I: IntoIterator<Item = Definition>,
pub fn has_definitions(&self) -> bool
pub fn definition_count(&self) -> usize
pub fn contains_definition(&self, name: &Identifier) -> bool
pub fn definition(&self, name: &Identifier) -> Option<&Definition>
pub fn definition_mut(&mut self, name: &Identifier) -> Option<&mut Definition>
pub fn definitions(&self) -> impl Iterator<Item = &Definition>
pub fn definitions_mut(&mut self) -> impl Iterator<Item = &mut Definition>
pub fn definition_names(&self) -> impl Iterator<Item = &Identifier>
pub fn add_to_definitions<I>(&mut self, value: I) -> Result<(), Error>where
I: Into<Definition>,
pub fn extend_definitions<I>(&mut self, extension: I) -> Result<(), Error>where
I: IntoIterator<Item = Definition>,
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 const fn is_versioned(&self) -> bool
pub fn is_library_module(&self) -> bool
pub fn resolve_local(&self, name: &Identifier) -> Option<&Definition>
pub fn imported_modules(&self) -> BTreeSet<&Identifier>
pub fn imported_module_versions( &self, ) -> BTreeMap<&Identifier, Option<&HeaderValue<Url>>>
pub fn imported_types(&self) -> BTreeSet<&QualifiedIdentifier>
pub fn get_definition(&self, name: &Identifier) -> Option<&Definition>
pub fn datatype_definitions(&self) -> impl Iterator<Item = &DatatypeDef>
pub fn entity_definitions(&self) -> impl Iterator<Item = &EntityDef>
pub fn enum_definitions(&self) -> impl Iterator<Item = &EnumDef>
pub fn event_definitions(&self) -> impl Iterator<Item = &EventDef>
pub fn property_definitions(&self) -> impl Iterator<Item = &PropertyDef>
pub fn rdf_definitions(&self) -> impl Iterator<Item = &RdfDef>
pub fn structure_definitions(&self) -> impl Iterator<Item = &StructureDef>
pub fn type_class_definitions(&self) -> impl Iterator<Item = &TypeClassDef>
pub fn union_definitions(&self) -> impl Iterator<Item = &UnionDef>
pub fn defined_names(&self) -> BTreeSet<&Identifier>
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 HasAnnotations for Module
impl HasAnnotations for Module
fn has_annotations(&self) -> bool
fn annotation_count(&self) -> usize
fn annotations(&self) -> impl Iterator<Item = &Annotation>
fn annotations_mut(&mut self) -> impl Iterator<Item = &mut Annotation>
fn add_to_annotations<I>(&mut self, value: I)where
I: Into<Annotation>,
fn extend_annotations<I>(&mut self, extension: I)where
I: IntoIterator<Item = Annotation>,
fn with_annotations<I>(self, annotations: I) -> Self
fn has_annotation_properties(&self) -> bool
fn annotation_properties(&self) -> impl Iterator<Item = &AnnotationProperty>
fn has_rdf_type(&self, type_id: &IdentifierReference) -> bool
fn rdf_types(&self) -> impl Iterator<Item = &IdentifierReference>
fn preferred_label(&self) -> impl Iterator<Item = &LanguageString>
fn alternate_labels(&self) -> impl Iterator<Item = &LanguageString>
fn descriptions(&self) -> impl Iterator<Item = &LanguageString>
fn skos_definitions(&self) -> impl Iterator<Item = &LanguageString>
fn has_constraints(&self) -> bool
fn annotation_constraints(&self) -> impl Iterator<Item = &Constraint>
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 BTreeSet<&'a IdentifierReference>)
fn referenced_annotations<'a>( &'a self, names: &mut BTreeSet<&'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<A> AnnotationBuilder for Awhere
A: HasAnnotations,
impl<A> AnnotationBuilder for Awhere
A: HasAnnotations,
fn with_predicate<I, V>(self, predicate: I, value: V) -> A
fn with_type<I>(self, name: I) -> Self
fn with_super_class<I>(self, name: I) -> Self
fn with_equivalent_class<I>(self, name: I) -> Self
fn with_super_property<I>(self, name: I) -> Self
fn with_domain<I>(self, name: I) -> Self
fn with_comment<S>(self, comment: S) -> Self
fn with_label<S>(self, label: S) -> Self
fn with_see_also_str(self, resource: &str) -> Selfwhere
Self: Sized,
fn with_see_also(self, resource: Url) -> Selfwhere
Self: Sized,
fn with_see_also_ref<I>(self, resource: I) -> Self
fn with_is_defined_by(self, resource: Url) -> Selfwhere
Self: Sized,
fn with_is_defined_by_str(self, resource: &str) -> Selfwhere
Self: Sized,
fn with_is_defined_by_ref<I>(self, resource: I) -> Self
fn with_range<I>(self, name: I) -> Self
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