Skip to main content

SliceToken

Trait SliceToken 

Source
pub trait SliceToken: Sized {
    // Required methods
    fn from_token(token: &str) -> Option<Self>;
    fn token(&self) -> &str;
}
Expand description

A closed registry vocabulary, as a slice column spells it.

Implemented by the token enums a slice carries. The two directions are deliberately not symmetric: from_token is fallible because a foreign slice may use a token this build has never heard of, and token is not because a value that exists was either recognised or carried verbatim.

Required Methods§

Source

fn from_token(token: &str) -> Option<Self>

The token as the registry TOML spells it, or None if this build does not know it.

Source

fn token(&self) -> &str

The canonical spelling — for a value parsed from a slice, byte-equal to what the slice carried.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§