Crate subparse [] [src]

This crate provides a common interface for popular subtitle formats (.srt, .ssa, .ass, .idx).

Files can be parsed, modified and saved again - some formats can be created from scratch. The focus is on non-destructive parsing, meaning that formatting and other information are preserved if not explicitely changed. Note that not all features of a specific subtitle format are supported.

Modules

errors

Error-chain generated error types.

timetypes

Types that represent a time point, duration and time span.

Structs

IdxFile

Represents a reconstructable .idx file.

SrtFile

Represents a reconstructable .srt file.

SsaFile

Represents a reconstructable .ssa/.ass file.

SubtitleEntry

The data which can be read from/written to a subtitle file.

Enums

SubtitleFormat

All formats which are supported by this library.

Traits

ParseSubtitle

This trait is implemented for all subtitle files.

ParseSubtitleString

This trait is implemented for all text subtitle file types which can be parsed from a string.

SubtitleFile

This trait represents the generic interface for reading and writing subtitle information across all subtitle formats.

Functions

get_subtitle_format_by_ending

Returns the subtitle format by the file ending (Option as return type).

get_subtitle_format_by_ending_err

Returns the subtitle format by the file ending (Result as return type).

parse_file_from_string

Parse text subtitle, invoking the right parser given by format.