Struct brane_dsl::symbol_table::FunctionEntry

source ·
pub struct FunctionEntry {
    pub name: String,
    pub signature: FunctionSignature,
    pub params: Vec<Rc<RefCell<VarEntry>>>,
    pub package_name: Option<String>,
    pub package_version: Option<Version>,
    pub class_name: Option<String>,
    pub arg_names: Vec<String>,
    pub requirements: Option<HashSet<Capability>>,
    pub index: usize,
    pub range: TextRange,
}
Expand description

Defines a function entry within the SymbolTable.

Fields§

§name: String

The name of the function entry.

§signature: FunctionSignature

The signature of the function entry.

§params: Vec<Rc<RefCell<VarEntry>>>

References to entries that form the Function’s parameters.

§package_name: Option<String>

If set to non-zero, then this function is imported from a package with the given name.

§package_version: Option<Version>

If set to non-zero, then this function is imported from a package with the given version.

§class_name: Option<String>

If set to non-zero, then this function is a method in the class with the given name.

§arg_names: Vec<String>

If this function is external (i.e., package_name is not None), then this list represents the name of each of the arguments. It will thus always be as long as the number of arguments in that case (and empty otherwise).

§requirements: Option<HashSet<Capability>>

Any requirements the function has in terms of hardware support. Only ever not-None if an external function.

§index: usize

The index in the workflow buffer of this function.

§range: TextRange

Points to the entire function definition (or import).

Implementations§

source§

impl FunctionEntry

source

pub fn from_builtin<S: Into<String>>( name: S, signature: FunctionSignature, range: TextRange, ) -> Self

Creates a FunctionEntry as if it was defined as a builtin function.

§Generic arguments
  • S: The String-like type of the function’s name.
§Arguments
  • name: The name of the FunctionEntry.
  • signature: The signature of the FunctionEntry.
  • range: The TextRange that points to the definition itself.
§Returns

A new FunctionEntry that has no package or class set, but does have type information populated.

source

pub fn from_def<S: Into<String>>(name: S, range: TextRange) -> Self

Creates a FunctionEntry as if it was defined in the source text.

§Generic arguments
  • S: The String-like type of the function’s name.
§Arguments
  • name: The name of the FunctionEntry.
  • range: The TextRange that points to the definition itself.
§Returns

A new FunctionEntry that has no package or class set, and not yet any type information populated.

source

pub fn from_import<S1: Into<String>, S2: Into<String>>( name: S1, signature: FunctionSignature, package: S2, package_version: Version, arg_names: Vec<String>, requirements: HashSet<Capability>, range: TextRange, ) -> Self

Creates a FunctionEntry as if it was imported by the given package.

§Generic arguments
  • S1: The String-like type of the function’s name.
  • S2: The String-like type of the package.
§Arguments
  • name: The name of the FunctionEntry.
  • signature: The FunctionSignature of this function.
  • package: The name of the package to which this function belongs.
  • package_version: The version of the package to which this function belongs.
  • arg_names: The names of the arguments (corresponds index-wise to the signature::arg list).
  • requirements: The list of hardware requirements (as Capabilities) as defined in the function’s package file.
  • range: The TextRange that points to the definition itself (i.e., the import statement).
§Returns

A new FunctionEntry that has the given package set, and not yet any type information populated.

source

pub fn from_method<S1: Into<String>, S2: Into<String>>( name: S1, class: S2, range: TextRange, ) -> Self

Creates a FunctionEntry as if it was a class method.

§Generic arguments
  • S1: The String-like type of the function’s name.
  • S2: The String-like type of the class.
§Arguments
  • name: The name of the FunctionEntry.
  • class: The name of the Class to which this function belongs.
  • range: The TextRange that points to the definition itself (i.e., the import statement).
§Returns

A new FunctionEntry that has the given class set, and not yet any type information populated.

Trait Implementations§

source§

impl Clone for FunctionEntry

source§

fn clone(&self) -> FunctionEntry

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for FunctionEntry

source§

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

Formats the value using the given formatter. Read more

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, dst: *mut T)

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

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
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 = 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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T