pub struct RequireCallInfo {
pub source: String,
pub span: Span,
pub source_span: Span,
pub destructured_names: Vec<String>,
pub destructured_locals: Vec<(String, String)>,
pub local_name: Option<String>,
pub is_type_only: bool,
}Expand description
A require() call.
Fields§
§source: StringThe require specifier.
span: SpanSource span of the require() call.
source_span: SpanSpan of the string-literal argument with quotes ('./x'), which anchors an
unresolved-import diagnostic. Span::default() for a non-literal argument.
destructured_names: Vec<String>Names destructured from the require() result.
destructured_locals: Vec<(String, String)>The (key, local) pair of each destructured identifier property:
const { exec: run } = require(...) gives ("exec", "run").
local_name: Option<String>The local variable name for const x = require(...).
is_type_only: booltrue for import type X = require('...'), the one require spelling
TypeScript erases entirely: the emitted JavaScript contains no
require call, so the target is a type-space reference and never a
runtime dependency. Always false for const x = require(...), which
has no type-only spelling. Read by dependency classification so a
type-only devDependency is not reported as production usage.
Trait Implementations§
Source§impl Clone for RequireCallInfo
impl Clone for RequireCallInfo
Source§fn clone(&self) -> RequireCallInfo
fn clone(&self) -> RequireCallInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Forget for RequireCallInfo
impl Freeze for RequireCallInfo
impl Move for RequireCallInfo
impl RefUnwindSafe for RequireCallInfo
impl Send for RequireCallInfo
impl Sync for RequireCallInfo
impl Unpin for RequireCallInfo
impl UnsafeUnpin for RequireCallInfo
impl UnwindSafe for RequireCallInfo
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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