Trait hit_data::ModelField[][src]

pub trait ModelField: Any {
    fn get_name(&self) -> String;
fn validate(
        &self,
        value: &ObjectValue,
        context: &ValidatorContext<'_>
    ) -> Result<Option<Vec<ValidationError>>, HitError>;
fn accepts_for_set(
        &self,
        value: &ObjectValue,
        context: &ValidatorContext<'_>
    ) -> bool;
fn accepts_model(&self, model: &Model) -> bool;
fn is_vec_reference(&self) -> bool;
fn is_vec_subobject(&self) -> bool;
fn on_kernel_init(&mut self, model_name: &str) -> Result<(), HitError>; }

Required methods

fn get_name(&self) -> String[src]

fn validate(
    &self,
    value: &ObjectValue,
    context: &ValidatorContext<'_>
) -> Result<Option<Vec<ValidationError>>, HitError>
[src]

fn accepts_for_set(
    &self,
    value: &ObjectValue,
    context: &ValidatorContext<'_>
) -> bool
[src]

fn accepts_model(&self, model: &Model) -> bool[src]

fn is_vec_reference(&self) -> bool[src]

fn is_vec_subobject(&self) -> bool[src]

fn on_kernel_init(&mut self, model_name: &str) -> Result<(), HitError>[src]

Loading content...

Implementations

impl dyn ModelField[src]

pub fn is<T: ModelField>(&self) -> bool[src]

Returns true if the boxed type is the same as T

pub fn downcast_ref<T: ModelField>(&self) -> Option<&T>[src]

Returns some reference to the boxed value if it is of type T, or None if it isn’t.

pub unsafe fn downcast_ref_unchecked<T: ModelField>(&self) -> &T[src]

Returns a reference to the boxed value, blindly assuming it to be of type T. If you are not absolutely certain of T, you must not call this.

pub fn downcast_mut<T: ModelField>(&mut self) -> Option<&mut T>[src]

Returns some mutable reference to the boxed value if it is of type T, or None if it isn’t.

pub unsafe fn downcast_mut_unchecked<T: ModelField>(&mut self) -> &mut T[src]

Returns a mutable reference to the boxed value, blindly assuming it to be of type T. If you are not absolutely certain of T, you must not call this.

impl dyn ModelField[src]

pub fn downcast<T: ModelField>(self: Box<Self>) -> Result<Box<T>, Box<Self>>[src]

Returns the boxed value if it is of type T, or Err(Self) if it isn’t.

pub unsafe fn downcast_unchecked<T: ModelField>(self: Box<Self>) -> Box<T>[src]

Returns the boxed value, blindly assuming it to be of type T. If you are not absolutely certain of T, you must not call this.

Implementors

impl ModelField for FieldTypeBool[src]

impl ModelField for FieldTypeDate[src]

impl ModelField for FieldTypeFloat[src]

impl ModelField for FieldTypeInteger[src]

impl ModelField for FieldTypeReference[src]

impl ModelField for FieldTypeReferenceArray[src]

impl ModelField for FieldTypeString[src]

impl ModelField for FieldTypeStringVec[src]

impl ModelField for FieldTypeSubobject[src]

impl ModelField for FieldTypeSubobjectArray[src]

Loading content...