up_rust/validation_state.rs
1// Copyright (c) 2026 Contributors to the Eclipse Foundation
2//
3// SPDX-License-Identifier: Apache-2.0
4
5//! Validation typestate markers shared by builder-validated types
6//! ([`UOwnedFrame`](crate::UOwnedFrame), [`UTxLoanSpec`](crate::UTxLoanSpec)).
7
8/// Typestate marker: not yet validated.
9///
10/// Values in this state come from decode paths or `new_unchecked`
11/// constructors; the only way forward is the type's `validate` method,
12/// which transitions to [`Validated`].
13#[derive(Clone, Copy, Debug, PartialEq)]
14pub enum Unvalidated {}
15
16/// Typestate marker: validation has passed.
17///
18/// This is the default state parameter — the type written plain means a
19/// validated value, which is what every transport API accepts.
20#[derive(Clone, Copy, Debug, PartialEq)]
21pub enum Validated {}