Skip to main content

FormatName

Trait FormatName 

Source
pub trait FormatName {
    const NAME: &'static str;
}
Expand description

The name of a JSON Schema format, as it appears in a schema.

Implement it on a marker type to declare a format this crate does not ship — pairing it with ValidatorBuilder::format, which supplies the check:

ⓘ
struct EmployeeId;
impl FormatName for EmployeeId { const NAME: &'static str = "employee-id"; }

Required Associated Constants§

Source

const NAME: &'static str

The format keyword’s value, e.g. "email".

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl FormatName for Date

Source§

const NAME: &'static str = "date"

Source§

impl FormatName for DateTime

Source§

const NAME: &'static str = "date-time"

Source§

impl FormatName for Duration

Source§

const NAME: &'static str = "duration"

Source§

impl FormatName for Email

Source§

const NAME: &'static str = "email"

Source§

impl FormatName for Hostname

Source§

const NAME: &'static str = "hostname"

Source§

impl FormatName for IdnEmail

Source§

const NAME: &'static str = "idn-email"

Source§

impl FormatName for Ipv4

Source§

const NAME: &'static str = "ipv4"

Source§

impl FormatName for Ipv6

Source§

const NAME: &'static str = "ipv6"

Source§

impl FormatName for JsonPointer

Source§

const NAME: &'static str = "json-pointer"

Source§

impl FormatName for RelativeJsonPointer

Source§

const NAME: &'static str = "relative-json-pointer"

Source§

impl FormatName for Time

Source§

const NAME: &'static str = "time"

Source§

impl FormatName for Uuid

Source§

const NAME: &'static str = "uuid"