glubs/srt

Types

Cue represents a single cue in a srt file.

pub type Cue {
  Cue(id: Int, start_time: Int, end_time: Int, payload: String)
}

Constructors

  • Cue(id: Int, start_time: Int, end_time: Int, payload: String)
pub type Srt {
  Srt(cues: List(Cue))
}

Constructors

  • Srt(cues: List(Cue))

Functions

pub fn parse(input: String) -> Result(Srt, String)

Parses a Srt string and returns a Result containing the parsed Srt structure or a parsing error.

pub fn to_string(srt: Srt) -> String

Converts a Srt type to a string.

Search Document