pub struct Entity {
pub kind: Kind,
pub name: String,
pub path: Option<PathBuf>,
pub lineno: Option<usize>,
pub endlineno: Option<usize>,
pub docstring: Option<Docstring>,
pub attributes: BTreeSet<String>,
pub detail: Detail,
pub members: BTreeMap<String, Entity>,
}Expand description
One entity of the MATLAB path.
Fields§
§kind: KindThe kind of entity.
name: StringThe name: the file stem for files, the method or property name for members.
path: Option<PathBuf>The file that declares the entity (the folder for packages, class folders and plain folders). Members inherit the file of their class.
lineno: Option<usize>First line (1-based). None when the entity has no span (maxx’s convention for
folders, packages, class folders and scripts).
endlineno: Option<usize>Last line (1-based, inclusive).
docstring: Option<Docstring>The comment block next to the declaration (or the file header, see the README).
attributes: BTreeSet<String>The attributes, sorted, as Name or Name=value (for example Access=private).
detail: DetailThe kind-specific fields.
members: BTreeMap<String, Entity>The members: properties, methods, enumeration members, local functions, and for packages, class folders and plain folders their files and sub-packages.
Implementations§
Source§impl Entity
impl Entity
Sourcepub fn function(&self) -> Option<&FunctionDetail>
pub fn function(&self) -> Option<&FunctionDetail>
The function detail, if this entity is a function or method.
Sourcepub fn property(&self) -> Option<&PropertyDetail>
pub fn property(&self) -> Option<&PropertyDetail>
The property detail, if this entity is a property.
Sourcepub fn events(&self) -> &[String]
pub fn events(&self) -> &[String]
The names of the events entries, if this entity is a class (source order).
Sourcepub fn declares_constructor(&self) -> bool
pub fn declares_constructor(&self) -> bool
Whether the class file declares a constructor (a method named as the class), if this
entity is a class. An implicit constructor is not declared, so it is false.
Sourcepub fn sections(&self) -> &[LiveSection]
pub fn sections(&self) -> &[LiveSection]
The sections, if this entity is a live script.
Sourcepub fn enumeration_value(&self) -> Option<&Expr>
pub fn enumeration_value(&self) -> Option<&Expr>
The enumeration value, if this entity is an enumeration member with one.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Entity
impl<'de> Deserialize<'de> for Entity
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 Entity
impl StructuralPartialEq for Entity
Auto Trait Implementations§
impl Forget for Entity
impl Freeze for Entity
impl Move for Entity
impl RefUnwindSafe for Entity
impl Send for Entity
impl Sync for Entity
impl Unpin for Entity
impl UnsafeUnpin for Entity
impl UnwindSafe for Entity
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
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.