pub struct SfcScript {
pub body: String,
pub is_typescript: bool,
pub is_jsx: bool,
pub byte_offset: usize,
pub src: Option<String>,
pub src_span: Option<Span>,
pub is_setup: bool,
pub is_context_module: bool,
pub generic_attr: Option<String>,
}Expand description
An extracted <script> block from a Vue or Svelte SFC.
Fields§
§body: StringThe script body text.
is_typescript: boolWhether the script uses TypeScript (lang="ts" or lang="tsx").
is_jsx: boolWhether the script uses JSX syntax (lang="tsx" or lang="jsx").
byte_offset: usizeByte offset of the script body within the full SFC source.
src: Option<String>External script source path from src attribute.
src_span: Option<Span>Span of the src attribute value in the full SFC source.
is_setup: boolWhether this script is a Vue <script setup> block.
is_context_module: boolWhether this script is a Svelte module-context block.
generic_attr: Option<String>Type-parameter list from a generic="..." (Vue) or generics="..."
(Svelte) attribute on the script tag. Holds the bare constraint, no
surrounding angle brackets, e.g. T extends Test<boolean>.
Auto Trait Implementations§
impl Freeze for SfcScript
impl RefUnwindSafe for SfcScript
impl Send for SfcScript
impl Sync for SfcScript
impl Unpin for SfcScript
impl UnsafeUnpin for SfcScript
impl UnwindSafe for SfcScript
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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