pub struct FQName {
pub package_path: Path,
pub module_path: Path,
pub local_name: Name,
}Expand description
FQName represents a Fully Qualified Name (PackagePath + ModulePath + LocalName).
The wire form is the canonical string package/path:module/path#local-name; the reader also
accepts the legacy three-element array [package, module, local], where the two paths are
legacy arrays of legacy names. schemars is told the schema is a string because that is what
the writer emits and what every schema consumer expects.
Fields§
§package_path: Path§module_path: Path§local_name: NameImplementations§
Source§impl FQName
impl FQName
pub fn new(package_path: Path, module_path: Path, local_name: Name) -> Self
Sourcepub fn to_canonical_string(&self) -> String
pub fn to_canonical_string(&self) -> String
Convert to V4 canonical string format: package/path:module/path#local-name
Sourcepub fn from_canonical_string(s: &str) -> Result<Self, String>
pub fn from_canonical_string(s: &str) -> Result<Self, String>
Parse from V4 canonical string format: package/path:module/path#local-name
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FQName
Reads a fully qualified name from the canonical string or the legacy three-element array.
impl<'de> Deserialize<'de> for FQName
Reads a fully qualified name from the canonical string or the legacy three-element array.
This is written out rather than derived through #[serde(try_from = "String")] for two
reasons. A derived try_from only ever sees a string, so the legacy array
[[["morphir"], ["s","d","k"]], [["list"]], ["map"]] — the spelling every classic document
uses — could not be read at all. And its error is a bare String, so the code and the cursor
are lost by the time serde hands it back; the refusals below carry a Diagnostic through
DiagnosticError instead.
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>,
impl Eq for FQName
Source§impl JsonSchema for FQName
impl JsonSchema for FQName
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreimpl StructuralPartialEq for FQName
Auto Trait Implementations§
impl Freeze for FQName
impl RefUnwindSafe for FQName
impl Send for FQName
impl Sync for FQName
impl Unpin for FQName
impl UnsafeUnpin for FQName
impl UnwindSafe for FQName
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
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
key and return true if they are equal.