pub trait EnvExt: Sealed {
// Required methods
fn filename(&self) -> Result<Utf8PathBuf>;
fn require<T: FromNapiValue>(&self, id: impl AsRef<str>) -> Result<T>;
fn require_resolve(&self, id: impl AsRef<str>) -> Result<String>;
fn import(
&self,
specifier: impl AsRef<str>,
options: Option<Object<'_>>,
) -> Result<Promise<Object<'_>>>;
fn import_meta_resolve(&self, specifier: impl AsRef<str>) -> Result<String>;
fn is_main(&self) -> Result<bool>;
}Required Methods§
fn filename(&self) -> Result<Utf8PathBuf>
fn require<T: FromNapiValue>(&self, id: impl AsRef<str>) -> Result<T>
fn require_resolve(&self, id: impl AsRef<str>) -> Result<String>
fn import( &self, specifier: impl AsRef<str>, options: Option<Object<'_>>, ) -> Result<Promise<Object<'_>>>
fn import_meta_resolve(&self, specifier: impl AsRef<str>) -> Result<String>
fn is_main(&self) -> Result<bool>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.