pub struct ModuleName(pub Path);Expand description
ModuleName is a newtype wrapper around Path for type safety. It distinguishes module paths from package paths at the type level.
Tuple Fields§
§0: PathImplementations§
Source§impl ModuleName
impl ModuleName
Sourcepub fn parse(s: &str) -> Self
pub fn parse(s: &str) -> Self
Create a ModuleName from a string (e.g., “Module/SubModule”)
This is a convenience wrapper around FromStr::from_str.
Sourcepub fn path(&self) -> &Path
pub fn path(&self) -> &Path
Get the underlying Path. Equivalent to ModuleName::as_path.
Sourcepub fn to_canonical_string(&self) -> String
pub fn to_canonical_string(&self) -> String
Render using super::CANONICAL_STYLE.
Sourcepub fn from_canonical_string(source: &str) -> Result<Self, String>
pub fn from_canonical_string(source: &str) -> Result<Self, String>
Parse a canonical module path in either encoding.
Trait Implementations§
Source§impl Clone for ModuleName
impl Clone for ModuleName
Source§impl Debug for ModuleName
impl Debug for ModuleName
Source§impl<'de> Deserialize<'de> for ModuleName
impl<'de> Deserialize<'de> for ModuleName
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 ModuleName
impl Display for ModuleName
impl Eq for ModuleName
Source§impl From<ModuleName> for Path
impl From<ModuleName> for Path
Source§fn from(module: ModuleName) -> Self
fn from(module: ModuleName) -> Self
Converts to this type from the input type.
Source§impl From<Path> for ModuleName
impl From<Path> for ModuleName
Source§impl FromStr for ModuleName
impl FromStr for ModuleName
Source§impl Hash for ModuleName
impl Hash for ModuleName
Source§impl JsonSchema for ModuleName
impl JsonSchema for ModuleName
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for ModuleName
impl PartialEq for ModuleName
Source§impl Serialize for ModuleName
impl Serialize for ModuleName
impl StructuralPartialEq for ModuleName
Auto Trait Implementations§
impl Freeze for ModuleName
impl RefUnwindSafe for ModuleName
impl Send for ModuleName
impl Sync for ModuleName
impl Unpin for ModuleName
impl UnsafeUnpin for ModuleName
impl UnwindSafe for ModuleName
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.