Expand description
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. - Mdvd
File - Represents a reconstructable
.sub
(MicroDVD
) file. - SrtFile
- Represents a
.srt
file. - SsaFile
- Represents a reconstructable
.ssa
/.ass
file. - Subtitle
Entry - The data which can be read from/written to a subtitle file.
- VobFile
- Represents a
.sub
(VobSub
) file.
Enums§
- Subtitle
File - Unified wrapper around the all individual subtitle file types.
- Subtitle
Format - All formats which are supported by this library.
Traits§
- Subtitle
File Interface - 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
.