Crate subparse[][src]

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

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.

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.

MdvdFile

Represents a reconstructable .sub(MicroDVD) file.

SrtFile

Represents a .srt file.

SsaFile

Represents a reconstructable .ssa/.ass file.

SubtitleEntry

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

VobFile

Represents a .sub (VobSub) file.

Enums

SubtitleFile

Unified wrapper around the all individual subtitle file types.

SubtitleFormat

All formats which are supported by this library.

Traits

SubtitleFileInterface

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

Functions

get_subtitle_format

Returns the subtitle format by the file extension and provided content.

get_subtitle_format_by_extension

Returns the subtitle format by the file extension.

get_subtitle_format_by_extension_err

Returns the subtitle format by the file extension.

get_subtitle_format_err

Returns the subtitle format by the file extension and provided content.

is_valid_extension_for_subtitle_format

Returns true if the file extension is valid for the given subtitle format.

parse_bytes

Parse all subtitle formats, invoking the right parser given by format.

parse_str

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