Crate aspasia

Source
Expand description

aspasia is a subtitle parsing library for Rust

Re-exports§

pub use timing::Moment;
pub use timing::TimeDelta;

Modules§

microdvd
MicroDVD (.sub) format subtitle implementations
plain
Implementations for plain subtitles
subrip
SubRip (.srt) format subtitle implementations
substation
SubStation (.ass / .ssa) format subtitle implementations
timing
Types used for subtitle timing
webvtt
WebVTT (.vtt) format subtitle implementations

Structs§

AssSubtitle
Advanced SubStation Alpha v4+ (.ass) subtitle
MicroDvdSubtitle
Unmodified MicroDVD subtitle, with events timed in terms of frames.
PlainSubtitle
Basic subtitle data containing only the textual content and start/end timing with no style or formatting information
SsaSubtitle
SubStation Alpha v4 (.ssa) subtitle
SubRipSubtitle
SubRip (.srt) subtitle data, containing only a list of events.
TimedMicroDvdSubtitle
Timed version of MicroDVD (.sub) subtitle, using user-supplied framerate to calculate timings
WebVttSubtitle
WebVTT (.vtt) subtitle data

Enums§

Error
Wrapper around errors that can potentially be produced by aspasia
Format
Supported file formats
TimedSubtitleFile
Convenience interface for interacting with time-based subtitle files in a generic manner.

Traits§

Subtitle
Base trait for all subtitle implementations.
TextEvent
Trait offering helper functions for textual subtitle events
TextEventInterface
Interface for getting/modifying textual subtitle event fields. Required for implementation of TextEvent.
TextSubtitle
Trait representing textual subtitle formats
TimedEvent
Helper methods for time-based subtitle events.
TimedEventInterface
Interface for interacting with timed events. Required for implementation of TimedEvent.
TimedSubtitle
Time-based subtitle

Functions§

detect_format
Attempt to detect subtitle format from its extension first, then by file contents if that fails
detect_format_by_content
Attempt to detect subtitle format from file contents
detect_format_by_content_with_encoding
Attempt to detect subtitle format from file contents, using specified encoding to read file
detect_format_by_extension
Attempt to detect subtitle format using its file extension
detect_format_from_str
Attempt to detect subtitle format from text of the first few lines of the subtitle
detect_format_with_encoding
Attempt to detect subtitle format from its extension first, then by file contents using the given encoding if that fails