Struct ScriptAnalysis

Source
pub struct ScriptAnalysis<'a> {
    pub script: &'a Script<'a>,
    /* private fields */
}
Available on crate feature analysis only.
Expand description

Comprehensive analysis of an ASS script

Provides linting, style resolution, and performance analysis. Results are cached for efficient repeated access.

Fields§

§script: &'a Script<'a>

Reference to analyzed script

Implementations§

Source§

impl<'a> ScriptAnalysis<'a>

Source

pub fn analyze(script: &'a Script<'a>) -> Result<Self>

Analyze script with default configuration

Performs comprehensive analysis including linting, style resolution, and event analysis. Results are cached for efficient access. Analyze ASS script for issues, styles, and content

§Performance

Target <2ms for typical scripts. Uses lazy evaluation for expensive operations like Unicode analysis.

§Errors

Returns an error if script analysis fails or contains invalid data.

Source

pub fn analyze_with_registry( script: &'a Script<'a>, registry: Option<&'a ExtensionRegistry>, config: AnalysisConfig, ) -> Result<Self>

Analyze script with extension registry support

Same as analyze but allows custom tag handlers via registry. Uses default analysis configuration.

§Arguments
  • script - Script to analyze
  • registry - Optional registry for custom tag handlers
§Errors

Returns an error if script analysis fails or contains invalid data.

Source

pub fn analyze_with_config( script: &'a Script<'a>, config: AnalysisConfig, ) -> Result<Self>

Analyze script with custom configuration

Allows fine-tuning analysis behavior for specific use cases.

§Errors

Returns an error if script analysis fails or contains invalid data.

Source

pub fn lint_issues(&self) -> &[LintIssue]

Get all lint issues found during analysis

Source

pub fn resolved_styles(&self) -> &[ResolvedStyle<'a>]

Get resolved styles

Source

pub fn dialogue_info(&self) -> &[DialogueInfo<'a>]

Get dialogue analysis results

Source

pub const fn script(&self) -> &'a Script<'a>

Get reference to the analyzed script

Source

pub fn resolve_style(&self, name: &str) -> Option<&ResolvedStyle<'a>>

Find resolved style by name

Source

pub fn has_critical_issues(&self) -> bool

Check if script has any critical issues

Source

pub fn performance_summary(&self) -> PerformanceSummary

Get performance summary

Trait Implementations§

Source§

impl<'a> Clone for ScriptAnalysis<'a>

Source§

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

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for ScriptAnalysis<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for ScriptAnalysis<'a>

§

impl<'a> !RefUnwindSafe for ScriptAnalysis<'a>

§

impl<'a> Send for ScriptAnalysis<'a>

§

impl<'a> Sync for ScriptAnalysis<'a>

§

impl<'a> Unpin for ScriptAnalysis<'a>

§

impl<'a> !UnwindSafe for ScriptAnalysis<'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.

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.

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.