Skip to main content

ScriptGrouping

Struct ScriptGrouping 

Source
pub struct ScriptGrouping<'a> {
    pub table: &'a LanguageTable,
    pub engine: Option<&'a str>,
}
Expand description

Which language each part of an app’s script belongs to.

engine is the app’s [script] engine key, which puts every script, inline and external, on one language. Otherwise each external file belongs to its extension’s language (an extension no language claims reads as the default language), and the inline block joins the app’s one external language when there is exactly one, and the default language otherwise.

Fields§

§table: &'a LanguageTable

The descriptors in reach.

§engine: Option<&'a str>

The [script] engine override.

Implementations§

Source§

impl ScriptGrouping<'_>

Source

pub fn external_language(&self, rel: &str) -> String

The language an external script file belongs to.

Source

pub fn inline_language(&self, externals: &[&str]) -> String

The language the inline block belongs to, given the app’s external script files.

Source

pub fn languages(&self, has_inline: bool, externals: &[&str]) -> Vec<String>

The languages an app needs, from whether it has an inline block and the paths of its external script files: what a run loads hosts for before anything is parsed.

Source

pub fn group( &self, inline: &str, inline_map: &SourceMap, externals: &[ScriptFile<'_>], ) -> GroupedScripts

Split an app’s script by language. inline is the inline blocks and inline_map where each of them was written; externals is each external file, in source order.

Trait Implementations§

Source§

impl<'a> Clone for ScriptGrouping<'a>

Source§

fn clone(&self) -> ScriptGrouping<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for ScriptGrouping<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Copy for ScriptGrouping<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for ScriptGrouping<'a>

§

impl<'a> RefUnwindSafe for ScriptGrouping<'a>

§

impl<'a> Send for ScriptGrouping<'a>

§

impl<'a> Sync for ScriptGrouping<'a>

§

impl<'a> Unpin for ScriptGrouping<'a>

§

impl<'a> UnsafeUnpin for ScriptGrouping<'a>

§

impl<'a> UnwindSafe for ScriptGrouping<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoResult<T> for T

§

fn into_result(self) -> Result<T, RunSystemError>

Converts this type into the system output type.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ConditionalSend for T
where T: Send,