pub struct Name {
pub raw: String,
pub value: Vec<String>,
pub ty: Type,
}Expand description
Definition of an artifact name, with Traits for hashing, displaying, etc
Fields§
§raw: Stringuser definition
value: Vec<String>standardized version
ty: Typethe inferred type of the artifact
Implementations§
Source§impl Name
impl Name
pub fn from_string(s: String) -> Result<Name>
Sourcepub fn parent(&self) -> Option<Name>
pub fn parent(&self) -> Option<Name>
parse name from string and handle errors see: SPC-artifact-name.2 see: SPC-artifact-partof-2
pub fn parent_rc(&self) -> Option<NameRc>
Sourcepub fn named_partofs(&self) -> Vec<Name>
pub fn named_partofs(&self) -> Vec<Name>
return the artifact this artifact is automatically a partof (because of it’s name) see: SPC-artifact-partof-1
Trait Implementations§
Source§impl Ord for Name
impl Ord for Name
Source§impl PartialOrd for Name
impl PartialOrd for Name
impl Eq for Name
Auto Trait Implementations§
impl Freeze for Name
impl RefUnwindSafe for Name
impl Send for Name
impl Sync for Name
impl Unpin for Name
impl UnwindSafe for Name
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,
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.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