# Semantic Version Library (Ver)

### Example Usage

```rust
#[main]
fn main() {
    const version = 1.2.3;
    assert_eq(version.major(), 1);
    assert_eq(version.minor(), 2);
    assert_eq(version.patch(), 3);
    assert_eq(version as str, "1.2.3");
}
```

## Ver.build(ver: ver) -> str

Return the build portion of this semantic version.

```rust
const ver = 1.2.3-release+build;
assert_eq(ver.build(), "build");
```

## Ver.clear\_build(ver: ver) -> void

Clear the build portion of this semantic version.

```rust
const ver = 1.2.3-release+build;
ver.clear_build();
assert_eq(ver, 1.2.3-release);
```

## Ver.clear\_release(ver: ver) -> void

Clear the release portion of this semantic version.

```rust
const ver = 1.2.3-release+build;
ver.clear_release();
assert_eq(ver, 1.2.3+build);
```

## Ver.major(ver: ver) -> int

Return the major portion of this semantic version.

```rust
const ver = 1.2.3-release+build;
assert_eq(ver.major(), 1);
```

## Ver.minor(ver: ver) -> int

Return the minor portion of this semantic version.

```rust
const ver = 1.2.3-release+build;
assert_eq(ver.minor(), 2);
```

## Ver.patch(ver: ver) -> int

Return the patch portion of this semantic version.

```rust
const ver = 1.2.3-release+build;
assert_eq(ver.patch(), 3);
```

## Ver.release(ver: ver) -> str

Return the release portion of this semantic version.

```rust
const ver = 1.2.3-release+build;
assert_eq(ver.release(), "release");
```

## Ver.set\_build(ver: ver, val: str) -> void

Set the build portion of this semantic version.

```rust
const ver = 1.2.3-release+build;
ver.set_build("modified");
assert_eq(ver, 1.2.3-release+modified);
```

## Ver.set\_major(ver: ver, val: int) -> void

Set the major portion of this semantic version.

```rust
const ver = 1.2.3-release+build;
ver.set_major(4);
assert_eq(ver, 4.2.3-release+build);
```

## Ver.set\_minor(ver: ver, val: int) -> void

Set the minor portion of this semantic version.

```rust
const ver = 1.2.3-release+build;
ver.set_minor(4);
assert_eq(ver, 1.4.3-release+build);
```

## Ver.set\_patch(ver: ver, val: int) -> void

Set the patch portion of this semantic version.

```rust
const ver = 1.2.3-release+build;
ver.set_patch(4);
assert_eq(ver, 1.2.4-release+build);
```

## Ver.set\_release(ver: ver, val: str) -> void

Set the release portion of this semantic version.

```rust
const ver = 1.2.3-release+build;
ver.set_release("modified");
assert_eq(ver, 1.2.3-modified+build);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.stof.dev/libraries/type-libraries/semantic-version-library-ver.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
