pub struct ImportStatement { /* private fields */ }Expand description
Corresponds the grammar rule import_statement.
Implementations§
Source§impl ImportStatement
impl ImportStatement
pub const fn new(imports: Vec<Import>) -> Self
pub fn new_module(import: Identifier) -> Self
pub fn new_module_with_version_uri(import: Identifier, version_uri: Url) -> Self
pub fn new_member(import: QualifiedIdentifier) -> Self
pub fn has_from_module_path(&self) -> bool
pub fn from_module_path(&self) -> Option<&ModulePath>
pub fn set_from_module_path(&mut self, path: ModulePath)
pub fn unset_from_module_path(&mut self)
pub fn has_imports(&self) -> bool
pub fn imports_len(&self) -> usize
pub fn imports(&self) -> impl Iterator<Item = &Import>
pub fn imports_mut(&mut self) -> impl Iterator<Item = &mut Import>
pub fn add_to_imports<I>(&mut self, value: I)
pub fn extend_imports<I>(&mut self, extension: I)where
I: IntoIterator<Item = Import>,
pub fn as_slice(&self) -> &[Import]
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>
Trait Implementations§
Source§impl Clone for ImportStatement
impl Clone for ImportStatement
Source§fn clone(&self) -> ImportStatement
fn clone(&self) -> ImportStatement
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 ImportStatement
impl Debug for ImportStatement
Source§impl Default for ImportStatement
impl Default for ImportStatement
Source§fn default() -> ImportStatement
fn default() -> ImportStatement
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ImportStatement
impl<'de> Deserialize<'de> for ImportStatement
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 From<Import> for ImportStatement
impl From<Import> for ImportStatement
Source§impl From<ImportStatement> for Vec<Import>
impl From<ImportStatement> for Vec<Import>
Source§fn from(value: ImportStatement) -> Self
fn from(value: ImportStatement) -> Self
Converts to this type from the input type.
Source§impl FromIterator<Import> for ImportStatement
impl FromIterator<Import> for ImportStatement
Source§impl HasSourceSpan for ImportStatement
impl HasSourceSpan for ImportStatement
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 Serialize for ImportStatement
impl Serialize for ImportStatement
Source§impl Validate for ImportStatement
impl Validate for ImportStatement
Source§fn validate(
&self,
top: &Module,
cache: &impl ModuleStore,
loader: &impl ModuleLoader,
_: bool,
)
fn validate( &self, top: &Module, cache: &impl ModuleStore, loader: &impl ModuleLoader, _: bool, )
Auto Trait Implementations§
impl Freeze for ImportStatement
impl RefUnwindSafe for ImportStatement
impl Send for ImportStatement
impl Sync for ImportStatement
impl Unpin for ImportStatement
impl UnsafeUnpin for ImportStatement
impl UnwindSafe for ImportStatement
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