Skip to main content

SchemaPossibleTypes

Trait SchemaPossibleTypes 

Source
pub trait SchemaPossibleTypes<'a>: Sized {
    // Required methods
    fn add_possible_type(&mut self, ctx: &'a ASTContext, object: &'a str);
    fn get_possible_types(&self) -> Vec<'a, &'a str>;

    // Provided methods
    fn get_possible_type(&self, name: &'a str) -> Option<&'a str> { ... }
    fn is_possible_type(&self, schema_object: &SchemaObject<'a>) -> bool { ... }
}
Expand description

Generic trait for any schema type that implements interfaces

Required Methods§

Source

fn add_possible_type(&mut self, ctx: &'a ASTContext, object: &'a str)

Add a new SchemaObject to the list of possible types

Source

fn get_possible_types(&self) -> Vec<'a, &'a str>

Get list of possible SchemaObject types

Provided Methods§

Source

fn get_possible_type(&self, name: &'a str) -> Option<&'a str>

Get a specific possible type by name if it exists on the type

Source

fn is_possible_type(&self, schema_object: &SchemaObject<'a>) -> bool

Checks whether given [ObjectType] is a possible subtype

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§