pub trait Token {
// Required methods
fn from_ai_token(token: u8) -> Self;
fn to_ai_token(&self) -> Result<u8, TokenError>;
fn from_fair_token(token: u16) -> Self;
fn to_fair_token(&self) -> Result<u16, TokenError>;
// Provided methods
fn to_ai_tokens(tokens: &[Self]) -> Result<Vec<u8>, TokenError>
where Self: Sized { ... }
fn to_fair_tokens(tokens: &[Self]) -> Result<Vec<u16>, TokenError>
where Self: Sized { ... }
}Required Methods§
fn from_ai_token(token: u8) -> Self
fn to_ai_token(&self) -> Result<u8, TokenError>
fn from_fair_token(token: u16) -> Self
fn to_fair_token(&self) -> Result<u16, TokenError>
Provided Methods§
fn to_ai_tokens(tokens: &[Self]) -> Result<Vec<u8>, TokenError>where
Self: Sized,
fn to_fair_tokens(tokens: &[Self]) -> Result<Vec<u16>, TokenError>where
Self: Sized,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".