Skip to main content

Symbol

Struct Symbol 

Source
pub struct Symbol {
Show 13 fields pub id: SymbolId, pub name: String, pub kind: SymbolKind, pub visibility: Visibility, pub file: SourcePath, pub span: Span, pub parent: Option<SymbolId>, pub signature: Option<String>, pub doc: Option<String>, pub generics: Vec<String>, pub tags: Vec<String>, pub members: Vec<Member>, pub flow: Option<Flow>,
}
Expand description

A named definition in the codebase.

Fields§

§id: SymbolId

Canonical id.

§name: String

Short name.

§kind: SymbolKind

Kind of definition.

§visibility: Visibility

Visibility.

§file: SourcePath

File the definition lives in.

§span: Span

Where in the file.

§parent: Option<SymbolId>

Enclosing symbol (the type for a method, the module for an item).

§signature: Option<String>

One-line signature, e.g. pub fn connect(&self, addr: &str) -> Result<Conn>.

§doc: Option<String>

First sentence of the doc comment, if any. Kept short on purpose: it is context for an agent, not a copy of the docs.

§generics: Vec<String>

Generic parameters as written (T: Clone, 'a, const N: usize).

§tags: Vec<String>

Notable attributes / modifiers: derives (derive(Debug)), async, unsafe, const, test, cfg(...), trait name for trait impls, etc.

§members: Vec<Member>

Fields, variants and associated items.

§flow: Option<Flow>

Ordered control/call flow of the body, for callables.

Implementations§

Source§

impl Symbol

Source

pub fn new( id: SymbolId, name: impl Into<String>, kind: SymbolKind, file: SourcePath, ) -> Self

A symbol with only the required fields set; everything else empty / private. Frontends fill in the rest.

Trait Implementations§

Source§

impl Clone for Symbol

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Symbol

Source§

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

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

impl<'de> Deserialize<'de> for Symbol

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for Symbol

Source§

impl PartialEq for Symbol

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Symbol

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Symbol

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.