コンテンツにスキップ

parse

このコンテンツはまだ日本語訳がありません。

Defined in: tle.rs:129

Available on crate feature alloc only.

fn parse(text: &str) -> [Result<ParsedElementSet, TleParseError>](https://doc.rust-lang.org/std/result/enum.Result.html)

Parse a TLE into a ParsedElementSet.

Accepts exactly one element set, as blank-line-padded:

  • 2 lines: line 1 + line 2
  • 3 lines: name + line 1 + line 2

Anything past those lines is TleParseError::TrailingLines. This returns one ParsedElementSet, so a caller handing it a catalog of several satellites gets told rather than getting the first one.

Both lines must carry a correct mod-10 checksum digit and the same catalog number, so a hand-edited digit or a pair of lines from two different satellites is rejected rather than read as an orbit.