Skip to main content

SchemaFields

Trait SchemaFields 

Source
pub trait SchemaFields<'a>: Sized {
    // Required methods
    fn add_field(&mut self, ctx: &'a ASTContext, field: SchemaField<'a>);
    fn get_fields(
        &self,
    ) -> HashMap<&'a str, &'a SchemaField<'a>, DefaultHashBuilder, &'a Bump>;

    // Provided method
    fn get_field(&self, name: &'a str) -> Option<&'a SchemaField<'a>> { ... }
}
Expand description

Generic trait for any schema type that implements fields

Required Methods§

Source

fn add_field(&mut self, ctx: &'a ASTContext, field: SchemaField<'a>)

Add a new SchemaField to the list of fields

Source

fn get_fields( &self, ) -> HashMap<&'a str, &'a SchemaField<'a>, DefaultHashBuilder, &'a Bump>

Get a [Map] of all fields

Provided Methods§

Source

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

Get a known field by name

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§