typeid_prefix 1.3.0-alpha

A Rust library that implements a type-safe version of the TypePrefix section of the `TypeID` Specification
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::ValidationError;

/// A marker trait for types that can be validated as a `TypeID` prefix.
///
/// This trait is automatically implemented for any type that implements
/// `AsRef<str>` and can be converted to a `TypeIdPrefix` using `TryFrom`.
pub trait Validate {}

impl<T> Validate for T
where
    T: AsRef<str> + TryFrom<T, Error=ValidationError>,
{}