Struct ion_schema::system::PendingTypes
source · [−]pub struct PendingTypes { /* private fields */ }Expand description
Stores information about types that are in the process of being defined.
An ISL type definition can include types that are not yet fully defined. For example, an ISL type definition might include:
- A reference to itself. This could happen in a recursive structure like a linked list or binary tree.
- A nested anonymous type definition.
Because the
SchemaSystemdoes not yet know the complete definition of these types, it cannot find them in theTypeStore. An instance ofPendingTypesis used to track information about types that we do not have a complete definition for yet. When theSchemaSystemfinishes loading these types, the type definitions inPendingTypescan be promoted theTypeStore.
Implementations
sourceimpl PendingTypes
impl PendingTypes
sourcepub fn update_type_store(
&mut self,
type_store: &mut TypeStore,
load_isl_import: Option<&IslImport>
) -> IonSchemaResult<bool>
pub fn update_type_store(
&mut self,
type_store: &mut TypeStore,
load_isl_import: Option<&IslImport>
) -> IonSchemaResult<bool>
Adds all the types from PendingTypes into given TypeStore including adding all the imported types into imports of TypeStore.
It also clears PendingTypes types for loading next set of types.
This method is used after a schema named type/root type is loaded entirely into PendingTypes
type_store- The TypeStore which will be updated with the types within this PendingTypeload_isl_import- If this argument is Some(isl_import), then we are not within an import process of schema. Based on given enum variant isl_import we will add the types to type_store. Otherwise we will add all the types from this PendingTypes to TypeStore. Returns true, if this update is not for an isl import type or it is for an isl import type but it is added to the type_store Otherwise, returns false if this update is for an isl import type and it is not yet added to the type_store.
Trait Implementations
sourceimpl Clone for PendingTypes
impl Clone for PendingTypes
sourcefn clone(&self) -> PendingTypes
fn clone(&self) -> PendingTypes
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 PendingTypes
impl Debug for PendingTypes
sourceimpl Default for PendingTypes
impl Default for PendingTypes
sourcefn default() -> PendingTypes
fn default() -> PendingTypes
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for PendingTypes
impl !Send for PendingTypes
impl !Sync for PendingTypes
impl Unpin for PendingTypes
impl UnwindSafe for PendingTypes
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