pub struct FunctionDef {
pub fqn: Arc<str>,
pub short_name: Arc<str>,
pub params: Arc<[FnParam]>,
pub return_type: Option<Arc<Type>>,
pub inferred_return_type: Option<Arc<Type>>,
pub template_params: Vec<TemplateParam>,
pub assertions: Vec<Assertion>,
pub throws: Vec<Arc<str>>,
pub deprecated: Option<Arc<str>>,
pub is_pure: bool,
pub location: Option<Location>,
pub docstring: Option<Arc<str>>,
}Fields§
§fqn: Arc<str>§short_name: Arc<str>§params: Arc<[FnParam]>§return_type: Option<Arc<Type>>Type from annotation (@return / native type hint). None means unannotated.
Stored as Option<Arc<Type>> to enable deduplication of common return types.
inferred_return_type: Option<Arc<Type>>See MethodDef::inferred_return_type — Option<Arc<Type>> (8 B) for the
same demand-driven-inference reason.
template_params: Vec<TemplateParam>§assertions: Vec<Assertion>§throws: Vec<Arc<str>>§deprecated: Option<Arc<str>>§is_pure: bool§location: Option<Location>§docstring: Option<Arc<str>>Plain-text description from the docblock (text before @tag lines).
Used for hover info.
Implementations§
Source§impl FunctionDef
impl FunctionDef
pub fn effective_return_type(&self) -> Option<&Type>
Trait Implementations§
Source§impl Clone for FunctionDef
impl Clone for FunctionDef
Source§fn clone(&self) -> FunctionDef
fn clone(&self) -> FunctionDef
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FunctionDef
impl Debug for FunctionDef
Source§impl<'de> Deserialize<'de> for FunctionDef
impl<'de> Deserialize<'de> for FunctionDef
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for FunctionDef
impl PartialEq for FunctionDef
Source§fn eq(&self, other: &FunctionDef) -> bool
fn eq(&self, other: &FunctionDef) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for FunctionDef
impl Serialize for FunctionDef
impl StructuralPartialEq for FunctionDef
Auto Trait Implementations§
impl Freeze for FunctionDef
impl RefUnwindSafe for FunctionDef
impl Send for FunctionDef
impl Sync for FunctionDef
impl Unpin for FunctionDef
impl UnsafeUnpin for FunctionDef
impl UnwindSafe for FunctionDef
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