Enum ion_schema::types::TypeDefinition
source · [−]pub enum TypeDefinition {
Named(TypeDefinitionImpl),
Anonymous(TypeDefinitionImpl),
BuiltIn(BuiltInTypeDefinition),
}Expand description
Represents a TypeDefinition which stores a resolved ISL type using TypeStore
Variants
Named(TypeDefinitionImpl)
Anonymous(TypeDefinitionImpl)
BuiltIn(BuiltInTypeDefinition)
Implementations
sourceimpl TypeDefinition
impl TypeDefinition
sourcepub fn named<A: Into<String>, B: Into<Vec<Constraint>>>(
name: A,
constraints: B
) -> TypeDefinition
pub fn named<A: Into<String>, B: Into<Vec<Constraint>>>(
name: A,
constraints: B
) -> TypeDefinition
Creates a named TypeDefinition using the IslConstraint defined within it
sourcepub fn anonymous<A: Into<Vec<Constraint>>>(constraints: A) -> TypeDefinition
pub fn anonymous<A: Into<Vec<Constraint>>>(constraints: A) -> TypeDefinition
Creates an anonymous TypeDefinition using the IslConstraint defined within it
sourcepub fn constraints(&self) -> &[Constraint]
pub fn constraints(&self) -> &[Constraint]
Provides the underlying constraints of TypeDefinitionImpl
sourcepub fn get_occurs_constraint(&self, validation_constraint_name: &str) -> Range
pub fn get_occurs_constraint(&self, validation_constraint_name: &str) -> Range
Returns an occurs constraint as range if it exists in the TypeDefinition otherwise returns occurs: required
Trait Implementations
sourceimpl Clone for TypeDefinition
impl Clone for TypeDefinition
sourcefn clone(&self) -> TypeDefinition
fn clone(&self) -> TypeDefinition
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 TypeDefinition
impl Debug for TypeDefinition
sourceimpl PartialEq<TypeDefinition> for TypeDefinition
impl PartialEq<TypeDefinition> for TypeDefinition
sourcefn eq(&self, other: &TypeDefinition) -> bool
fn eq(&self, other: &TypeDefinition) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourceimpl TypeValidator for TypeDefinition
impl TypeValidator for TypeDefinition
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
impl StructuralPartialEq for TypeDefinition
Auto Trait Implementations
impl RefUnwindSafe for TypeDefinition
impl !Send for TypeDefinition
impl !Sync for TypeDefinition
impl Unpin for TypeDefinition
impl UnwindSafe for TypeDefinition
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