[][src]Enum swc_ecma_ast::Program

pub enum Program {
    Module(Module),
    Script(Script),
}

Variants

Module(Module)
Script(Script)

Implementations

impl Program[src]

pub fn is_module(&self) -> bool[src]

Returns true if self is of variant Module.

pub fn expect_module(self) -> Module where
    Self: Debug
[src]

Unwraps the value, yielding the content of Module.

Panics

Panics if the value is not Module, with a panic message including the content of self.

pub fn module(self) -> Option<Module>[src]

Returns Some if self is of variant Module, and None otherwise.

pub fn is_script(&self) -> bool[src]

Returns true if self is of variant Script.

pub fn expect_script(self) -> Script where
    Self: Debug
[src]

Unwraps the value, yielding the content of Script.

Panics

Panics if the value is not Script, with a panic message including the content of self.

pub fn script(self) -> Option<Script>[src]

Returns Some if self is of variant Script, and None otherwise.

Trait Implementations

impl Clone for Program[src]

impl Debug for Program[src]

impl<'de> Deserialize<'de> for Program[src]

impl Eq for Program[src]

impl EqIgnoreSpan for Program[src]

impl From<Module> for Program[src]

impl From<Script> for Program[src]

impl Hash for Program[src]

impl PartialEq<Program> for Program[src]

impl Serialize for Program[src]

impl Spanned for Program[src]

impl StructuralEq for Program[src]

impl StructuralPartialEq for Program[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Send for T where
    T: ?Sized
[src]

impl<T> Sync for T where
    T: ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.