pub struct SchemaIR { /* private fields */ }
Implementations§
Source§impl SchemaIR
impl SchemaIR
pub fn new() -> SchemaIR
pub fn set_prefixmap(&mut self, prefixmap: Option<PrefixMap>)
pub fn prefixmap(&self) -> PrefixMap
pub fn add_shape(&mut self, shape_label: ShapeLabel, se: ShapeExpr)
pub fn get_shape_expr(&self, shape_label: &ShapeLabel) -> Option<&ShapeExpr>
pub fn from_schema_json( &mut self, schema_json: &SchemaJson, ) -> Result<(), SchemaIRError>
pub fn find_ref( &self, se_ref: &ShapeExprLabel, ) -> Result<ShapeLabelIdx, SchemaIRError>
pub fn find_label( &self, label: &ShapeLabel, ) -> Option<(&ShapeLabelIdx, &ShapeExpr)>
pub fn find_shape_label_idx(&self, label: &ShapeLabel) -> Option<&ShapeLabelIdx>
pub fn find_shape_idx( &self, idx: &ShapeLabelIdx, ) -> Option<&(Option<ShapeLabel>, ShapeExpr)>
pub fn shape_label_from_idx(&self, idx: &ShapeLabelIdx) -> Option<&ShapeLabel>
pub fn new_index(&mut self) -> ShapeLabelIdx
pub fn existing_labels(&self) -> Vec<&ShapeLabel>
pub fn shapes(&self) -> impl Iterator<Item = &(Option<ShapeLabel>, ShapeExpr)>
pub fn references( &self, idx: &ShapeLabelIdx, ) -> HashMap<Pred, Vec<ShapeLabelIdx>>
pub fn references_visited( &self, idx: &ShapeLabelIdx, visited: HashSet<ShapeLabelIdx>, ) -> HashMap<Pred, Vec<ShapeLabelIdx>>
pub fn get_shape_label_idx( &self, shape_label: &ShapeLabel, ) -> Result<ShapeLabelIdx, SchemaIRError>
pub fn replace_shape(&mut self, idx: &ShapeLabelIdx, se: ShapeExpr)
pub fn show_label(&self, label: &ShapeLabel) -> String
pub fn neg_cycles( &self, ) -> Vec<Vec<(ShapeLabelIdx, ShapeLabelIdx, Vec<ShapeLabelIdx>)>>
Sourcepub fn has_neg_cycle(&self) -> bool
pub fn has_neg_cycle(&self) -> bool
This is used to detect cycles that involve negations in the schema A well formed schema should not have any cyclic reference that involve a negation
pub fn dependencies(&self) -> Vec<(ShapeLabel, PosNeg, ShapeLabel)>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SchemaIR
impl !RefUnwindSafe for SchemaIR
impl !Send for SchemaIR
impl !Sync for SchemaIR
impl Unpin for SchemaIR
impl !UnwindSafe for SchemaIR
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more