pub struct ItemTree {
top_level: Box<[ModItemId]>,
attrs: ThinVec<(ModItemId, AttrsOrCfg)>,
vis: ItemVisibilities,
big_data: ThinVec<(FileAstId<Item>, BigModItem)>,
small_data: ThinVec<(FileAstId<Item>, SmallModItem)>,
}Expand description
The item tree of a source file.
Fields§
§top_level: Box<[ModItemId]>§attrs: ThinVec<(ModItemId, AttrsOrCfg)>Sorted by the id. The last item, if it has ModItemId::TOP_OWNER, is the top level attrs.
vis: ItemVisibilities§big_data: ThinVec<(FileAstId<Item>, BigModItem)>§small_data: ThinVec<(FileAstId<Item>, SmallModItem)>Implementations§
Source§impl ItemTree
impl ItemTree
Sourcepub(crate) fn top_level_items(&self) -> &[ModItemId]
pub(crate) fn top_level_items(&self) -> &[ModItemId]
Returns an iterator over all items located at the top level of the HirFileId this
ItemTree was created from.
Sourcepub(crate) fn top_level_attrs(&self) -> Option<&AttrsOrCfg>
pub(crate) fn top_level_attrs(&self) -> Option<&AttrsOrCfg>
Returns the inner attributes of the source file.
pub(crate) fn attrs(&self, of: ModItemId) -> Option<&AttrsOrCfg>
Sourcepub fn item_tree_stats(&self) -> ItemTreeDataStats
pub fn item_tree_stats(&self) -> ItemTreeDataStats
Returns a count of a few, expensive items.
For more detail, see ItemTreeDataStats.
pub fn pretty_print(&self, db: &dyn SourceDatabase, edition: Edition) -> String
fn is_empty(&self) -> bool
fn finalize(&mut self)
Trait Implementations§
impl Eq for ItemTree
Source§impl Index<RawVisibilityId> for ItemTree
impl Index<RawVisibilityId> for ItemTree
Source§type Output = RawVisibility
type Output = RawVisibility
The returned type after indexing.
impl StructuralPartialEq for ItemTree
Auto Trait Implementations§
impl Freeze for ItemTree
impl RefUnwindSafe for ItemTree
impl Send for ItemTree
impl Sync for ItemTree
impl Unpin for ItemTree
impl UnsafeUnpin for ItemTree
impl UnwindSafe for ItemTree
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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