pub struct FunctionProjection { /* private fields */ }Expand description
A schema-only typed function token/reference.
Implementations§
Source§impl FunctionProjection
impl FunctionProjection
Sourcepub fn new(
id: FunctionId,
target_name: TargetIdentifier,
parameters: Vec<FunctionParameterProjection>,
returns: FunctionReturnProjection,
) -> Result<Self, Diagnostic>
pub fn new( id: FunctionId, target_name: TargetIdentifier, parameters: Vec<FunctionParameterProjection>, returns: FunctionReturnProjection, ) -> Result<Self, Diagnostic>
Construct a function token without translating its body.
Sourcepub fn with_annotations(
self,
annotations: BTreeMap<AnnotationFactId, ProjectedAnnotation>,
) -> Result<Self, Diagnostic>
pub fn with_annotations( self, annotations: BTreeMap<AnnotationFactId, ProjectedAnnotation>, ) -> Result<Self, Diagnostic>
Attach effective function documentation and metadata.
Sourcepub const fn id(&self) -> &FunctionId
pub const fn id(&self) -> &FunctionId
Return the function identity.
Sourcepub const fn target_name(&self) -> &TargetIdentifier
pub const fn target_name(&self) -> &TargetIdentifier
Return the emitted function-token name.
Sourcepub fn parameters(&self) -> &[FunctionParameterProjection]
pub fn parameters(&self) -> &[FunctionParameterProjection]
Return parameters in signature order.
Sourcepub const fn returns(&self) -> &FunctionReturnProjection
pub const fn returns(&self) -> &FunctionReturnProjection
Return the native return shape.
Sourcepub const fn annotations(
&self,
) -> &BTreeMap<AnnotationFactId, ProjectedAnnotation>
pub const fn annotations( &self, ) -> &BTreeMap<AnnotationFactId, ProjectedAnnotation>
Return function documentation and metadata.
Trait Implementations§
Source§impl Clone for FunctionProjection
impl Clone for FunctionProjection
Source§fn clone(&self) -> FunctionProjection
fn clone(&self) -> FunctionProjection
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 FunctionProjection
impl Debug for FunctionProjection
impl Eq for FunctionProjection
Source§impl PartialEq for FunctionProjection
impl PartialEq for FunctionProjection
Source§impl Serialize for FunctionProjection
impl Serialize for FunctionProjection
impl StructuralPartialEq for FunctionProjection
Auto Trait Implementations§
impl Freeze for FunctionProjection
impl RefUnwindSafe for FunctionProjection
impl Send for FunctionProjection
impl Sync for FunctionProjection
impl Unpin for FunctionProjection
impl UnsafeUnpin for FunctionProjection
impl UnwindSafe for FunctionProjection
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