calyx_frontend

Struct LibrarySignatures

Source
pub struct LibrarySignatures { /* private fields */ }
Expand description

A representation of all the primitive definitions found while parsing the root program.

Implementations§

Source§

impl LibrarySignatures

Source

pub fn add_inline_primitive( &mut self, primitive: Primitive, ) -> &mut PrimitiveInfo

Add a new inline primitive to the context. Panics if a primitive with the same name is already defined.

Source

pub fn add_extern_primitive(&mut self, file: PathBuf, primitive: Primitive)

Add a new, non-inline primitive to the context. Panics if a primitive with the same name is already defined. Requires that the file path is absolute and canonical.

Source

pub fn find_primitive<S>(&self, name: S) -> Option<&Primitive>
where S: Into<Id>,

Return the Primitive associated with the given name if defined, otherwise return None.

Source

pub fn get_primitive<S>(&self, name: S) -> &Primitive
where S: Into<Id>,

Return the Primitive associated to this Id.

Source

pub fn mark_inline_source(&mut self, name: Id)

Mark an inlined primitive as a part of the source. This is useful when using file mode compilation and printing only the source primitives. Panics if the primitive is not defined.

Source

pub fn mark_extern_source(&mut self, path: PathBuf)

Marks an imported extern block as a part of the source. There is no way to mark an individual primitive as a part of the source since the entire file will be linked. Panics if the file path is not defined

Source

pub fn signatures(&self) -> impl Iterator<Item = &Primitive> + '_

Return an iterator over all defined primitives.

Source

pub fn prim_infos(&self) -> &Vec<PrimitiveInfo>

Returns all the underlying primitive information. If you want all the signatures, use LibrarySignatures::signatures instead.

Source

pub fn prim_inlines(&self) -> impl Iterator<Item = (&Primitive, bool)> + '_

Return the underyling inlined primitives and whether they are source defined

Source

pub fn extern_paths(&self) -> Vec<&PathBuf>

Return the paths for the extern defining files along with whether they are source defined.

Trait Implementations§

Source§

impl Debug for LibrarySignatures

Source§

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

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

impl Default for LibrarySignatures

Source§

fn default() -> LibrarySignatures

Returns the “default value” for a type. 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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. 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.