pub struct ModulePath { /* private fields */ }
Expand description
Corresponds the embedded choice in grammar rule from_clause
:
choice(
$.module_path_absolute,
$.module_path_relative,
$.module_path_root_only
)
Implementations§
Source§impl ModulePath
impl ModulePath
pub fn new<T>(is_absolute: bool, segments: T) -> Self
pub fn new_unchecked(is_absolute: bool, segments: &[&str]) -> Self
pub fn root() -> Self
pub fn absolute<T>(modules: T) -> Self
pub fn absolute_one(module: Identifier) -> Self
pub fn relative<T>(modules: T) -> Self
pub fn relative_one(module: Identifier) -> Self
pub fn is_absolute(&self) -> bool
pub fn set_absolute(&mut self, is_absolute: bool)
pub fn is_root(&self) -> bool
pub fn has_segments(&self) -> bool
pub fn segment_count(&self) -> usize
pub fn segments(&self) -> impl Iterator<Item = &Identifier>
pub fn segments_mut(&mut self) -> impl Iterator<Item = &mut Identifier>
pub fn add_to_segments<I>(&mut self, value: I)where
I: Into<Identifier>,
pub fn extend_segments<I>(&mut self, extension: I)where
I: IntoIterator<Item = Identifier>,
Trait Implementations§
Source§impl Clone for ModulePath
impl Clone for ModulePath
Source§fn clone(&self) -> ModulePath
fn clone(&self) -> ModulePath
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 ModulePath
impl Debug for ModulePath
Source§impl Default for ModulePath
impl Default for ModulePath
Source§fn default() -> ModulePath
fn default() -> ModulePath
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ModulePath
impl<'de> Deserialize<'de> for ModulePath
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 Display for ModulePath
impl Display for ModulePath
Source§impl FromStr for ModulePath
impl FromStr for ModulePath
Source§impl HasSourceSpan for ModulePath
impl HasSourceSpan for ModulePath
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 Hash for ModulePath
impl Hash for ModulePath
Source§impl PartialEq for ModulePath
impl PartialEq for ModulePath
Source§impl Serialize for ModulePath
impl Serialize for ModulePath
Source§impl Validate for ModulePath
impl Validate for ModulePath
fn validate( &self, _top: &Module, _cache: &impl ModuleStore, _loader: &impl ModuleLoader, _check_constraints: bool, )
impl Eq for ModulePath
impl StructuralPartialEq for ModulePath
Auto Trait Implementations§
impl Freeze for ModulePath
impl RefUnwindSafe for ModulePath
impl Send for ModulePath
impl Sync for ModulePath
impl Unpin for ModulePath
impl UnwindSafe for ModulePath
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