pub struct Spec {
pub qname: String,
pub name: String,
pub lib: String,
pub base: Option<String>,
pub meta: HashMap<String, Kind>,
pub slots: Vec<Slot>,
pub is_abstract: bool,
pub doc: String,
}Expand description
A resolved Xeto spec (type definition).
Fields§
§qname: StringFully qualified name ("lib::Name").
name: StringShort name ("Name").
lib: StringLibrary name ("lib").
base: Option<String>Base spec qualified name.
meta: HashMap<String, Kind>Metadata tags.
slots: Vec<Slot>Slots (child tag definitions).
is_abstract: boolWhether this spec is abstract.
doc: StringDocumentation string.
Implementations§
Source§impl Spec
impl Spec
Sourcepub fn new(
qname: impl Into<String>,
lib: impl Into<String>,
name: impl Into<String>,
) -> Self
pub fn new( qname: impl Into<String>, lib: impl Into<String>, name: impl Into<String>, ) -> Self
Create a new spec with the given qualified name.
Sourcepub fn mandatory_markers(&self) -> Vec<&str>
pub fn mandatory_markers(&self) -> Vec<&str>
Mandatory marker slot names (those without “maybe” meta).
Sourcepub fn effective_slots(&self, specs: &HashMap<String, Spec>) -> Vec<Slot>
pub fn effective_slots(&self, specs: &HashMap<String, Spec>) -> Vec<Slot>
Collect all slots including inherited ones from the base chain.
Sourcepub fn point_specs(&self) -> Vec<&Slot>
pub fn point_specs(&self) -> Vec<&Slot>
Children of the “points” slot, if present.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Spec
impl RefUnwindSafe for Spec
impl Send for Spec
impl Sync for Spec
impl Unpin for Spec
impl UnsafeUnpin for Spec
impl UnwindSafe for Spec
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