#sentry #parser #semver #name #version #object #convert

sentry-release-parser

A parser for the sentry release name format

17 releases (10 stable)

1.3.2 Aug 28, 2023
1.3.1 Apr 25, 2022
1.3.0 Jul 12, 2021
0.6.0 May 28, 2020
0.4.0 Jan 30, 2020

#1096 in Parser implementations

Download history 334/week @ 2024-07-21 165/week @ 2024-07-28 119/week @ 2024-08-04 139/week @ 2024-08-11 89/week @ 2024-08-18 133/week @ 2024-08-25 363/week @ 2024-09-01 89/week @ 2024-09-08 105/week @ 2024-09-15 312/week @ 2024-09-22 184/week @ 2024-09-29 147/week @ 2024-10-06 112/week @ 2024-10-13 81/week @ 2024-10-20 148/week @ 2024-10-27 130/week @ 2024-11-03

474 downloads per month

Apache-2.0

75KB
679 lines

sentry-release-parser

This package implements a release name parser that is used by Sentry.

use sentry_release_parser::Release;

let release = Release::parse("org.example.FooApp@1.0rc1+20200101100").unwrap();
assert_eq!(release.package(), Some("org.example.FooApp"));
assert_eq!(release.version_raw(), "1.0rc1+20200101100");

let version = release.version().unwrap();
assert_eq!(version.major(), 1);
assert_eq!(version.minor(), 0);
assert_eq!(version.patch(), 0);
assert_eq!(version.triple(), (1, 0, 0));
assert_eq!(version.pre(), Some("rc1"));
assert_eq!(version.build_code(), Some("20200101100"));

Features

  • semver: if enabled the version object provides a method to convert it into a semver if it's compatible.
  • serde: turns on serde serialization.

License: Apache-2.0


lib.rs:

This package implements a release name parser that is used by Sentry.

use sentry_release_parser::Release;

let release = Release::parse("org.example.FooApp@1.0rc1+20200101100").unwrap();
assert_eq!(release.package(), Some("org.example.FooApp"));
assert_eq!(release.version_raw(), "1.0rc1+20200101100");

let version = release.version().unwrap();
assert_eq!(version.major(), 1);
assert_eq!(version.minor(), 0);
assert_eq!(version.patch(), 0);
assert_eq!(version.triple(), (1, 0, 0));
assert_eq!(version.pre(), Some("rc1"));
assert_eq!(version.build_code(), Some("20200101100"));

Features

  • semver: if enabled the version object provides a method to convert it into a semver if it's compatible.
  • serde: turns on serde serialization.

Dependencies

~2.8–4.5MB
~72K SLoC