pub struct QualifiedProcedureName { /* private fields */ }Expand description
Represents a qualified procedure name, e.g. std::math::u64::add, parsed into it’s
constituent Path and ProcedureName components.
A qualified procedure name can be context-sensitive, i.e. the module path might refer to an imported
Implementations§
Source§impl QualifiedProcedureName
impl QualifiedProcedureName
Sourcepub fn new(module: impl AsRef<Path>, name: ProcedureName) -> Self
pub fn new(module: impl AsRef<Path>, name: ProcedureName) -> Self
Create a new QualifiedProcedureName with the given fully-qualified module path and procedure name.
pub fn with_span(self, span: SourceSpan) -> Self
Sourcepub fn as_path(&self) -> &Path
pub fn as_path(&self) -> &Path
Get this QualifiedProcedureName as a Path
Sourcepub fn to_spanned_path(&self) -> Span<&Path>
pub fn to_spanned_path(&self) -> Span<&Path>
Get this QualifiedProcedureName as a Span<&Path>
pub fn into_inner(self) -> Arc<Path>
Methods from Deref<Target = Path>§
pub const MAX_COMPONENT_LENGTH: usize = 255usize
pub const EMPTY: &Path
pub const KERNEL_PATH: &str = "$kernel"
pub const ABSOLUTE_KERNEL_PATH: &str = "::$kernel"
pub const KERNEL: &Path
pub const EXEC_PATH: &str = "$exec"
pub const ABSOLUTE_EXEC_PATH: &str = "::$exec"
pub const EXEC: &Path
pub fn as_str(&self) -> &str
Sourcepub fn to_path_buf(&self) -> PathBuf
pub fn to_path_buf(&self) -> PathBuf
Sourcepub fn char_len(&self) -> usize
pub fn char_len(&self) -> usize
Return the size of the path in chars when displayed as a string
Sourcepub fn byte_len(&self) -> usize
pub fn byte_len(&self) -> usize
Return the size of the path in bytes when displayed as a string
Sourcepub fn is_absolute(&self) -> bool
pub fn is_absolute(&self) -> bool
Returns true if this path is an absolute path
Sourcepub fn to_absolute(&self) -> Cow<'_, Path>
pub fn to_absolute(&self) -> Cow<'_, Path>
Make this path absolute, if not already
NOTE: This does not resolve the path, it simply ensures the path has the root prefix
Sourcepub fn to_relative(&self) -> &Path
pub fn to_relative(&self) -> &Path
Strip the root prefix from this path, if it has one.
Sourcepub fn components(&self) -> Iter<'_> ⓘ
pub fn components(&self) -> Iter<'_> ⓘ
Returns an iterator over all components of the path.
Sourcepub fn first(&self) -> Option<&str>
pub fn first(&self) -> Option<&str>
Get the first non-root component of this path as a str
Returns None if the path is empty, or consists only of the root prefix.
Sourcepub fn last(&self) -> Option<&str>
pub fn last(&self) -> Option<&str>
Get the first non-root component of this path as a str
Returns None if the path is empty, or consists only of the root prefix.
Sourcepub fn split_first(&self) -> Option<(&str, &Path)>
pub fn split_first(&self) -> Option<(&str, &Path)>
Splits this path on the first non-root component, returning it and a new Path of the remaining components.
Returns None if there are no components to split
Sourcepub fn split_last(&self) -> Option<(&str, &Path)>
pub fn split_last(&self) -> Option<(&str, &Path)>
Splits this path on the last component, returning it and a new Path of the remaining components.
Returns None if there are no components to split
Sourcepub fn is_kernel_path(&self) -> bool
pub fn is_kernel_path(&self) -> bool
Returns true if this path is for the root kernel module.
Sourcepub fn is_in_kernel(&self) -> bool
pub fn is_in_kernel(&self) -> bool
Returns true if this path is for the root kernel module or an item in it
Sourcepub fn is_exec_path(&self) -> bool
pub fn is_exec_path(&self) -> bool
Returns true if this path is for an executable module.
Sourcepub fn starts_with<Prefix>(&self, prefix: &Prefix) -> boolwhere
Prefix: ?Sized,
Self: StartsWith<Prefix>,
pub fn starts_with<Prefix>(&self, prefix: &Prefix) -> boolwhere
Prefix: ?Sized,
Self: StartsWith<Prefix>,
Returns true if the current path, sans root component, starts with prefix
Sourcepub fn starts_with_exactly<Prefix>(&self, prefix: &Prefix) -> boolwhere
Prefix: ?Sized,
Self: StartsWith<Prefix>,
pub fn starts_with_exactly<Prefix>(&self, prefix: &Prefix) -> boolwhere
Prefix: ?Sized,
Self: StartsWith<Prefix>,
Returns true if the current path, including root component, starts with prefix
Trait Implementations§
Source§impl AsRef<Path> for QualifiedProcedureName
impl AsRef<Path> for QualifiedProcedureName
Source§impl Clone for QualifiedProcedureName
impl Clone for QualifiedProcedureName
Source§fn clone(&self) -> QualifiedProcedureName
fn clone(&self) -> QualifiedProcedureName
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for QualifiedProcedureName
impl Debug for QualifiedProcedureName
Source§impl Deref for QualifiedProcedureName
impl Deref for QualifiedProcedureName
Source§impl Display for QualifiedProcedureName
impl Display for QualifiedProcedureName
Source§impl From<&Path> for QualifiedProcedureName
impl From<&Path> for QualifiedProcedureName
Source§impl From<PathBuf> for QualifiedProcedureName
impl From<PathBuf> for QualifiedProcedureName
Source§impl From<QualifiedProcedureName> for Arc<Path>
impl From<QualifiedProcedureName> for Arc<Path>
Source§fn from(value: QualifiedProcedureName) -> Self
fn from(value: QualifiedProcedureName) -> Self
Source§impl From<QualifiedProcedureName> for SourceSpan
impl From<QualifiedProcedureName> for SourceSpan
Source§fn from(fqn: QualifiedProcedureName) -> Self
fn from(fqn: QualifiedProcedureName) -> Self
Source§impl FromStr for QualifiedProcedureName
impl FromStr for QualifiedProcedureName
Source§impl Ord for QualifiedProcedureName
impl Ord for QualifiedProcedureName
Source§impl PartialEq for QualifiedProcedureName
impl PartialEq for QualifiedProcedureName
Source§impl PartialOrd for QualifiedProcedureName
impl PartialOrd for QualifiedProcedureName
Source§impl PrettyPrint for QualifiedProcedureName
impl PrettyPrint for QualifiedProcedureName
Source§fn to_pretty_string(&self) -> String
fn to_pretty_string(&self) -> String
Source§fn pretty_print(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn pretty_print(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Source§impl Spanned for QualifiedProcedureName
impl Spanned for QualifiedProcedureName
fn span(&self) -> SourceSpan
Source§impl TryFrom<&str> for QualifiedProcedureName
impl TryFrom<&str> for QualifiedProcedureName
Source§impl TryFrom<String> for QualifiedProcedureName
impl TryFrom<String> for QualifiedProcedureName
impl Eq for QualifiedProcedureName
Auto Trait Implementations§
impl Freeze for QualifiedProcedureName
impl RefUnwindSafe for QualifiedProcedureName
impl Send for QualifiedProcedureName
impl Sync for QualifiedProcedureName
impl Unpin for QualifiedProcedureName
impl UnwindSafe for QualifiedProcedureName
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more