Struct libgir::analysis::imports::ImportsWithDefault
source · pub struct ImportsWithDefault<'a> { /* private fields */ }
Methods from Deref<Target = Imports>§
pub fn with_defaults( &mut self, version: Option<Version>, constraint: &Option<String>, ) -> ImportsWithDefault<'_>
sourcepub fn add_defined(&mut self, name: &str)
pub fn add_defined(&mut self, name: &str)
Declares that name
is defined in scope
Removes existing imports from self.map
and marks name
as
available to counter future import “requests”.
sourcepub fn add(&mut self, name: &str)
pub fn add(&mut self, name: &str)
Declares that name should be available through its last path component.
For example, if name is X::Y::Z
then it will be available as Z
.
Uses defaults.
sourcepub fn add_with_version(&mut self, name: &str, version: Option<Version>)
pub fn add_with_version(&mut self, name: &str, version: Option<Version>)
Declares that name should be available through its last path component.
For example, if name is X::Y::Z
then it will be available as Z
.
sourcepub fn add_with_constraint(
&mut self,
name: &str,
version: Option<Version>,
constraint: Option<&str>,
)
pub fn add_with_constraint( &mut self, name: &str, version: Option<Version>, constraint: Option<&str>, )
Declares that name should be available through its last path component and provides an optional feature constraint.
For example, if name is X::Y::Z
then it will be available as Z
.
sourcepub fn add_used_type(&mut self, used_type: &str)
pub fn add_used_type(&mut self, used_type: &str)
Declares that name should be available through its full path.
For example, if name is X::Y
then it will be available as X::Y
.
pub fn add_used_types(&mut self, used_types: &[String])
sourcepub fn add_used_type_with_version(
&mut self,
used_type: &str,
version: Option<Version>,
)
pub fn add_used_type_with_version( &mut self, used_type: &str, version: Option<Version>, )
Declares that name should be available through its full path.
For example, if name is X::Y
then it will be available as X::Y
.