pub enum PathSyntax {
Scoped,
Posix,
}Expand description
The nouns of the plugin contract that appear in the engine’s answers, so
an interface needs nothing but this crate.
How a language spells paths: the separator between segments and the
words it uses for a head. A grammar declares one; it parses import text
into ModulePaths and spells them back.
Variants§
Scoped
crate::a::b, self::a, super::super::a, Self::A, serde::X.
Posix
./a/b, ../../a, /a/b, react/x, @scope/pkg.
Implementations§
Source§impl PathSyntax
impl PathSyntax
pub const fn separator(self) -> &'static str
Sourcepub fn parse(self, text: &str) -> ModulePath
pub fn parse(self, text: &str) -> ModulePath
Read a path as written. Lossless for what a grammar hands over:
spell(parse(text)) == text for every well-formed path.
Sourcepub fn spell(self, path: &ModulePath) -> String
pub fn spell(self, path: &ModulePath) -> String
The path as this syntax writes it.
Trait Implementations§
Source§impl Clone for PathSyntax
impl Clone for PathSyntax
Source§fn clone(&self) -> PathSyntax
fn clone(&self) -> PathSyntax
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 moreimpl Copy for PathSyntax
Source§impl Debug for PathSyntax
impl Debug for PathSyntax
Source§impl<'de> Deserialize<'de> for PathSyntax
impl<'de> Deserialize<'de> for PathSyntax
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PathSyntax, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PathSyntax, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for PathSyntax
Source§impl Hash for PathSyntax
impl Hash for PathSyntax
Source§impl Ord for PathSyntax
impl Ord for PathSyntax
Source§fn cmp(&self, other: &PathSyntax) -> Ordering
fn cmp(&self, other: &PathSyntax) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for PathSyntax
impl PartialEq for PathSyntax
Source§impl PartialOrd for PathSyntax
impl PartialOrd for PathSyntax
Source§impl Serialize for PathSyntax
impl Serialize for PathSyntax
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for PathSyntax
Auto Trait Implementations§
impl Freeze for PathSyntax
impl RefUnwindSafe for PathSyntax
impl Send for PathSyntax
impl Sync for PathSyntax
impl Unpin for PathSyntax
impl UnsafeUnpin for PathSyntax
impl UnwindSafe for PathSyntax
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more