Struct ion_schema::types::TypeDefinitionImpl
source · [−]pub struct TypeDefinitionImpl { /* private fields */ }Expand description
A TypeDefinitionImpl consists of an optional name and zero or more constraints.
Implementations
sourceimpl TypeDefinitionImpl
impl TypeDefinitionImpl
pub fn new(name: Option<String>, constraints: Vec<Constraint>) -> Self
pub fn name(&self) -> &Option<String>
pub fn with_name(self, alias: String) -> Self
pub fn constraints(&self) -> &[Constraint]
sourcepub fn parse_from_isl_type_and_update_pending_types(
isl_type: &IslTypeImpl,
type_store: &mut TypeStore,
pending_types: &mut PendingTypes
) -> IonSchemaResult<TypeId>
pub fn parse_from_isl_type_and_update_pending_types(
isl_type: &IslTypeImpl,
type_store: &mut TypeStore,
pending_types: &mut PendingTypes
) -> IonSchemaResult<TypeId>
Parse constraints inside an IslTypeImpl to a schema type definition, update the PendingTypes
and return its TypeId if the conversion was successful, otherwise return an IonSchemaError
Trait Implementations
sourceimpl Clone for TypeDefinitionImpl
impl Clone for TypeDefinitionImpl
sourcefn clone(&self) -> TypeDefinitionImpl
fn clone(&self) -> TypeDefinitionImpl
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for TypeDefinitionImpl
impl Debug for TypeDefinitionImpl
sourceimpl PartialEq<TypeDefinitionImpl> for TypeDefinitionImpl
impl PartialEq<TypeDefinitionImpl> for TypeDefinitionImpl
sourceimpl TypeValidator for TypeDefinitionImpl
impl TypeValidator for TypeDefinitionImpl
sourcefn is_valid(&self, value: &IonSchemaElement, type_store: &TypeStore) -> bool
fn is_valid(&self, value: &IonSchemaElement, type_store: &TypeStore) -> bool
If the specified value violates one or more of this type’s constraints,
returns false, otherwise true Read more
sourcefn validate(
&self,
value: &IonSchemaElement,
type_store: &TypeStore
) -> ValidationResult
fn validate(
&self,
value: &IonSchemaElement,
type_store: &TypeStore
) -> ValidationResult
Returns Err(violation) with details as to which constraints were violated,
otherwise returns Ok(()) indicating no violations were found during the validation Read more
Auto Trait Implementations
impl RefUnwindSafe for TypeDefinitionImpl
impl !Send for TypeDefinitionImpl
impl !Sync for TypeDefinitionImpl
impl Unpin for TypeDefinitionImpl
impl UnwindSafe for TypeDefinitionImpl
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more