pub struct Stdlib { /* private fields */ }Expand description
The standard library an embedder offers its programs: the core packages
every embedder has, plus the OptionalPackages it enables.
Compiling, discovery, the capability catalog and host-function installation
all read the same set, so a package is either fully present or fully absent.
The discovery methods (docs, search, resolve, …) are in
crate::packages.
Implementations§
Source§impl Stdlib
Discovery over the modules of a Stdlib: what the free functions above do
for Stdlib::core, for any set.
impl Stdlib
Discovery over the modules of a Stdlib: what the free functions above do
for Stdlib::core, for any set.
Sourcepub fn resolve(self, name: &str) -> Resolution
pub fn resolve(self, name: &str) -> Resolution
resolve over the modules of this set.
Sourcepub fn suggest_filtered(
self,
name: &str,
extra: &[String],
visible: impl Fn(&str) -> bool,
) -> Option<String>
pub fn suggest_filtered( self, name: &str, extra: &[String], visible: impl Fn(&str) -> bool, ) -> Option<String>
suggest_filtered over the modules of this set.
Sourcepub fn catalog_filtered(
self,
extra: Vec<CatalogEntry>,
visible: impl Fn(&str) -> bool,
) -> Catalog
pub fn catalog_filtered( self, extra: Vec<CatalogEntry>, visible: impl Fn(&str) -> bool, ) -> Catalog
catalog_filtered over the modules of this set.
Sourcepub fn render_stdlib_d_ts(self) -> String
pub fn render_stdlib_d_ts(self) -> String
render_stdlib_d_ts for the modules of this set.
Sourcepub fn render_packages_d_ts(
self,
packages: &[&PackageDeclaration],
context: &[&PackageDeclaration],
) -> String
pub fn render_packages_d_ts( self, packages: &[&PackageDeclaration], context: &[&PackageDeclaration], ) -> String
render_packages_d_ts against the modules of this set.
Source§impl Stdlib
impl Stdlib
pub const fn with(self, package: OptionalPackage) -> Self
pub const fn enables(self, package: OptionalPackage) -> bool
pub fn optional_packages(self) -> impl Iterator<Item = OptionalPackage>
Sourcepub fn contains_module(self, name: &str) -> bool
pub fn contains_module(self, name: &str) -> bool
Whether name is a package of this set.
Sourcepub fn package_declarations(self) -> Vec<PackageDeclaration>
pub fn package_declarations(self) -> Vec<PackageDeclaration>
Every package of this set, sorted by name.
pub fn install_host_functions( self, linker: &mut Linker<StoreData>, ) -> Result<()>
Trait Implementations§
impl Copy for Stdlib
impl Eq for Stdlib
impl StructuralPartialEq for Stdlib
Auto Trait Implementations§
impl Freeze for Stdlib
impl RefUnwindSafe for Stdlib
impl Send for Stdlib
impl Sync for Stdlib
impl Unpin for Stdlib
impl UnsafeUnpin for Stdlib
impl UnwindSafe for Stdlib
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.