pub struct SymbolInformation {
pub symbol: String,
pub documentation: Vec<String>,
pub relationships: Vec<Relationship>,
pub kind: EnumOrUnknown<Kind>,
pub display_name: String,
pub signature_documentation: MessageField<Document>,
pub enclosing_symbol: String,
pub special_fields: SpecialFields,
}
Expand description
SymbolInformation defines metadata about a symbol, such as the symbol’s docstring or what package it’s defined it.
Fields§
§symbol: String
Identifier of this symbol, which can be referenced from Occurence.symbol
.
The string must be formatted according to the grammar in Symbol
.
documentation: Vec<String>
(optional, but strongly recommended) The markdown-formatted documentation
for this symbol. Use SymbolInformation.signature_documentation
to
document the method/class/type signature of this symbol.
Due to historical reasons, indexers may include signature documentation in
this field by rendering markdown code blocks. New indexers should only
include non-code documentation in this field, for example docstrings.
relationships: Vec<Relationship>
(optional) Relationships to other symbols (e.g., implements, type definition).
kind: EnumOrUnknown<Kind>
The kind of this symbol. Use this field instead of
SymbolDescriptor.Suffix
to determine whether something is, for example, a
class or a method.
display_name: String
(optional) The name of this symbol as it should be displayed to the user.
For example, the symbol “com/example/MyClass#myMethod(+1).” should have the
display name “myMethod”. The symbol
field is not a reliable source of
the display name for several reasons:
- Local symbols don’t encode the name.
- Some languages have case-insensitive names, so the symbol is all-lowercase.
- The symbol may encode names with special characters that should not be displayed to the user.
signature_documentation: MessageField<Document>
(optional) The signature of this symbol as it’s displayed in API
documentation or in hover tooltips. For example, a Java method that adds
two numbers this would have Document.language = "java"
and Document.text = "void add(int a, int b)". The
languageand
textfields are required while other fields such as
Documentation.occurrences` can be optionally
included to support hyperlinking referenced symbols in the signature.
enclosing_symbol: String
(optional) The enclosing symbol if this is a local symbol. For non-local
symbols, the enclosing symbol should be parsed from the symbol
field
using the Descriptor
grammar.
The primary use-case for this field is to allow local symbol to be displayed
in a symbol hierarchy for API documentation. It’s OK to leave this field
empty for local variables since local variables usually don’t belong in API
documentation. However, in the situation that you wish to include a local
symbol in the hierarchy, then you can use enclosing_symbol
to locate the
“parent” or “owner” of this local symbol. For example, a Java indexer may
choose to use local symbols for private class fields while providing an
enclosing_symbol
to reference the enclosing class to allow the field to
be part of the class documentation hierarchy. From the perspective of an
author of an indexer, the decision to use a local symbol or global symbol
should exclusively be determined whether the local symbol is accessible
outside the document, not by the capability to find the enclosing
symbol.
special_fields: SpecialFields
Implementations§
Source§impl SymbolInformation
impl SymbolInformation
pub fn new() -> SymbolInformation
Trait Implementations§
Source§impl Clone for SymbolInformation
impl Clone for SymbolInformation
Source§fn clone(&self) -> SymbolInformation
fn clone(&self) -> SymbolInformation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for SymbolInformation
impl Debug for SymbolInformation
Source§impl<'a> Default for &'a SymbolInformation
impl<'a> Default for &'a SymbolInformation
Source§fn default() -> &'a SymbolInformation
fn default() -> &'a SymbolInformation
Source§impl Default for SymbolInformation
impl Default for SymbolInformation
Source§fn default() -> SymbolInformation
fn default() -> SymbolInformation
Source§impl Display for SymbolInformation
impl Display for SymbolInformation
Source§impl Message for SymbolInformation
impl Message for SymbolInformation
Source§const NAME: &'static str = "SymbolInformation"
const NAME: &'static str = "SymbolInformation"
.proto
file. Read moreSource§fn is_initialized(&self) -> bool
fn is_initialized(&self) -> bool
true
for protobuf 3.Source§fn merge_from(&mut self, is: &mut CodedInputStream<'_>) -> Result<()>
fn merge_from(&mut self, is: &mut CodedInputStream<'_>) -> Result<()>
Source§fn compute_size(&self) -> u64
fn compute_size(&self) -> u64
Source§fn write_to_with_cached_sizes(
&self,
os: &mut CodedOutputStream<'_>,
) -> Result<()>
fn write_to_with_cached_sizes( &self, os: &mut CodedOutputStream<'_>, ) -> Result<()>
Source§fn special_fields(&self) -> &SpecialFields
fn special_fields(&self) -> &SpecialFields
Source§fn mut_special_fields(&mut self) -> &mut SpecialFields
fn mut_special_fields(&mut self) -> &mut SpecialFields
Source§fn new() -> SymbolInformation
fn new() -> SymbolInformation
Source§fn default_instance() -> &'static SymbolInformation
fn default_instance() -> &'static SymbolInformation
Source§fn parse_from(is: &mut CodedInputStream<'_>) -> Result<Self, Error>
fn parse_from(is: &mut CodedInputStream<'_>) -> Result<Self, Error>
Source§fn cached_size(&self) -> u32
fn cached_size(&self) -> u32
compute_size
. Read moreSource§fn write_to(&self, os: &mut CodedOutputStream<'_>) -> Result<(), Error>
fn write_to(&self, os: &mut CodedOutputStream<'_>) -> Result<(), Error>
Source§fn write_length_delimited_to(
&self,
os: &mut CodedOutputStream<'_>,
) -> Result<(), Error>
fn write_length_delimited_to( &self, os: &mut CodedOutputStream<'_>, ) -> Result<(), Error>
Source§fn write_length_delimited_to_vec(&self, vec: &mut Vec<u8>) -> Result<(), Error>
fn write_length_delimited_to_vec(&self, vec: &mut Vec<u8>) -> Result<(), Error>
Source§fn merge_from_bytes(&mut self, bytes: &[u8]) -> Result<(), Error>
fn merge_from_bytes(&mut self, bytes: &[u8]) -> Result<(), Error>
Source§fn parse_from_reader(reader: &mut dyn Read) -> Result<Self, Error>
fn parse_from_reader(reader: &mut dyn Read) -> Result<Self, Error>
Source§fn check_initialized(&self) -> Result<(), Error>
fn check_initialized(&self) -> Result<(), Error>
Source§fn write_to_writer(&self, w: &mut dyn Write) -> Result<(), Error>
fn write_to_writer(&self, w: &mut dyn Write) -> Result<(), Error>
Source§fn write_length_delimited_to_writer(
&self,
w: &mut dyn Write,
) -> Result<(), Error>
fn write_length_delimited_to_writer( &self, w: &mut dyn Write, ) -> Result<(), Error>
Source§fn write_length_delimited_to_bytes(&self) -> Result<Vec<u8>, Error>
fn write_length_delimited_to_bytes(&self) -> Result<Vec<u8>, Error>
Source§fn unknown_fields(&self) -> &UnknownFields
fn unknown_fields(&self) -> &UnknownFields
Source§fn mut_unknown_fields(&mut self) -> &mut UnknownFields
fn mut_unknown_fields(&mut self) -> &mut UnknownFields
Source§impl MessageFull for SymbolInformation
impl MessageFull for SymbolInformation
Source§fn descriptor() -> MessageDescriptor
fn descriptor() -> MessageDescriptor
Source§fn reflect_eq(&self, other: &Self, mode: &ReflectEqMode) -> bool
fn reflect_eq(&self, other: &Self, mode: &ReflectEqMode) -> bool
Source§impl PartialEq for SymbolInformation
impl PartialEq for SymbolInformation
Source§impl ProtobufValue for SymbolInformation
impl ProtobufValue for SymbolInformation
Source§type RuntimeType = RuntimeTypeMessage<SymbolInformation>
type RuntimeType = RuntimeTypeMessage<SymbolInformation>
impl StructuralPartialEq for SymbolInformation
Auto Trait Implementations§
impl !Freeze for SymbolInformation
impl RefUnwindSafe for SymbolInformation
impl Send for SymbolInformation
impl Sync for SymbolInformation
impl Unpin for SymbolInformation
impl UnwindSafe for SymbolInformation
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,
Source§impl<M> MessageDyn for Mwhere
M: MessageFull,
impl<M> MessageDyn for Mwhere
M: MessageFull,
Source§fn descriptor_dyn(&self) -> MessageDescriptor
fn descriptor_dyn(&self) -> MessageDescriptor
Source§fn merge_from_dyn(&mut self, is: &mut CodedInputStream<'_>) -> Result<(), Error>
fn merge_from_dyn(&mut self, is: &mut CodedInputStream<'_>) -> Result<(), Error>
Source§fn write_to_with_cached_sizes_dyn(
&self,
os: &mut CodedOutputStream<'_>,
) -> Result<(), Error>
fn write_to_with_cached_sizes_dyn( &self, os: &mut CodedOutputStream<'_>, ) -> Result<(), Error>
Source§fn compute_size_dyn(&self) -> u64
fn compute_size_dyn(&self) -> u64
Source§fn is_initialized_dyn(&self) -> bool
fn is_initialized_dyn(&self) -> bool
true
for protobuf 3.