Skip to main content

Entry

Struct Entry 

Source
pub struct Entry<'t> {
    table: &'t Table,
    id: Handle,
}
Expand description

An immutable, object-like entry in a Table.

Entry wraps a Table and a Handle, and provides an ergonomic interface for querying information about the state of the node at that Handle.

Its mutable counterpart, EntryMut, provides a similar interface for modifying the state of the Table.

Fields§

§table: &'t Table§id: Handle

Implementations§

Source§

impl<'t> Entry<'t>

Source

pub const fn new(table: &'t Table, id: Handle) -> Self

Constructs a new Entry from shared &Table and a Handle.

Source

pub const fn id(&self) -> Handle

Gets the Handle associated with this Entry

Source

pub const fn inner(&'t self) -> &'t Table

Gets the Table associated with this Entry

Source

pub fn kind(&self) -> Option<&NodeKind>

Gets the NodeKind of this Entry in the Table

Source

pub const fn root(&self) -> Entry<'_>

Gets the Entry of the root node in the Table

Source

pub fn children(&self) -> Option<&SymMap<Handle>>

Gets the children of this node

Source

pub fn lazy_imports(&self) -> Option<&SymMap<Path>>

Gets the lazy-imports list for this node

Source

pub fn glob_imports(&self) -> Option<&[Path]>

Gets the glob-imports list for this node

Source

pub fn meta(&self) -> Option<&[Expr]>

Gets the meta-Expr list for this node

Source

pub fn name(&self) -> Option<Sym>

Gets an identifying Symbol for this node, if possible

Source

pub const fn with_id(&self, id: Handle) -> Entry<'t>

Constructs another Entry with the given Handle

Source

pub fn nav(&self, path: &[Sym]) -> Option<Entry<'t>>

Navigates to another Entry

Source

pub fn parent(&self) -> Option<Entry<'t>>

Gets the parent of this Entry

Source

pub fn ty(&self) -> Option<&'t TypeKind>

Gets the TypeKind of this Entry

Source

pub fn impl_target(&self) -> Option<Entry<'_>>

Gets the impl target of this Entry

Source

pub fn selfty(&self) -> Option<Entry<'_>>

Gets the Self type of this Entry

Trait Implementations§

Source§

impl Debug for Entry<'_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Entry<'_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'t> Freeze for Entry<'t>

§

impl<'t> RefUnwindSafe for Entry<'t>

§

impl<'t> Send for Entry<'t>

§

impl<'t> Sync for Entry<'t>

§

impl<'t> Unpin for Entry<'t>

§

impl<'t> UnwindSafe for Entry<'t>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.