pub struct LibrarySignatures { /* private fields */ }
Expand description
A representation of all the primitive definitions found while parsing the root program.
Implementations§
Source§impl LibrarySignatures
impl LibrarySignatures
Sourcepub fn add_inline_primitive(
&mut self,
primitive: Primitive,
) -> &mut PrimitiveInfo
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.
Sourcepub fn add_extern_primitive(&mut self, file: PathBuf, primitive: Primitive)
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.
Sourcepub fn find_primitive<S>(&self, name: S) -> Option<&Primitive>
pub fn find_primitive<S>(&self, name: S) -> Option<&Primitive>
Return the Primitive associated with the given name if defined, otherwise return None.
Sourcepub fn get_primitive<S>(&self, name: S) -> &Primitive
pub fn get_primitive<S>(&self, name: S) -> &Primitive
Return the Primitive associated to this Id.
Sourcepub fn mark_inline_source(&mut self, name: Id)
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.
Sourcepub fn mark_extern_source(&mut self, path: PathBuf)
pub fn mark_extern_source(&mut self, path: PathBuf)
Marks an import
ed 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
Sourcepub fn signatures(&self) -> impl Iterator<Item = &Primitive>
pub fn signatures(&self) -> impl Iterator<Item = &Primitive>
Return an iterator over all defined primitives.
Sourcepub fn prim_infos(&self) -> &Vec<PrimitiveInfo>
pub fn prim_infos(&self) -> &Vec<PrimitiveInfo>
Returns all the underlying primitive information. If you want all the signatures, use LibrarySignatures::signatures instead.
Sourcepub fn prim_inlines(&self) -> impl Iterator<Item = (&Primitive, bool)>
pub fn prim_inlines(&self) -> impl Iterator<Item = (&Primitive, bool)>
Return the underyling inlined primitives and whether they are source defined
Sourcepub fn extern_paths(&self) -> Vec<&PathBuf>
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
impl Debug for LibrarySignatures
Source§impl Default for LibrarySignatures
impl Default for LibrarySignatures
Source§fn default() -> LibrarySignatures
fn default() -> LibrarySignatures
Auto Trait Implementations§
impl Freeze for LibrarySignatures
impl RefUnwindSafe for LibrarySignatures
impl Send for LibrarySignatures
impl Sync for LibrarySignatures
impl Unpin for LibrarySignatures
impl UnwindSafe for LibrarySignatures
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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