Enum swc_ecma_ast::Program
source · [−]Variants
Module(Module)
Script(Script)
Implementations
sourceimpl Program
impl Program
sourcepub fn as_module(&self) -> Option<&Module>
pub fn as_module(&self) -> Option<&Module>
Returns Some
if self
is a reference of variant Module
, and None
otherwise.
sourcepub fn as_mut_module(&mut self) -> Option<&mut Module>
pub fn as_mut_module(&mut self) -> Option<&mut Module>
Returns Some
if self
is a mutable reference of variant Module
, and None
otherwise.
sourcepub fn expect_module(self) -> Modulewhere
Self: Debug,
pub fn expect_module(self) -> Modulewhere
Self: Debug,
sourcepub fn module(self) -> Option<Module>
pub fn module(self) -> Option<Module>
Returns Some
if self
is of variant Module
, and None
otherwise.
sourcepub fn as_script(&self) -> Option<&Script>
pub fn as_script(&self) -> Option<&Script>
Returns Some
if self
is a reference of variant Script
, and None
otherwise.
sourcepub fn as_mut_script(&mut self) -> Option<&mut Script>
pub fn as_mut_script(&mut self) -> Option<&mut Script>
Returns Some
if self
is a mutable reference of variant Script
, and None
otherwise.
sourcepub fn expect_script(self) -> Scriptwhere
Self: Debug,
pub fn expect_script(self) -> Scriptwhere
Self: Debug,
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Program
impl<'de> Deserialize<'de> for Program
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl EqIgnoreSpan for Program
impl EqIgnoreSpan for Program
fn eq_ignore_span(&self, other: &Self) -> bool
impl Eq for Program
impl StructuralEq for Program
impl StructuralPartialEq for Program
Auto Trait Implementations
impl RefUnwindSafe for Program
impl Send for Program
impl Sync for Program
impl Unpin for Program
impl UnwindSafe for Program
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more