pub struct GtsEntity {Show 14 fields
pub gts_id: Option<GtsID>,
pub instance_id: Option<String>,
pub is_schema: bool,
pub file: Option<GtsFile>,
pub list_sequence: Option<usize>,
pub label: String,
pub content: Value,
pub gts_refs: Vec<GtsRef>,
pub validation: ValidationResult,
pub schema_id: Option<String>,
pub selected_entity_field: Option<String>,
pub selected_schema_id_field: Option<String>,
pub description: String,
pub schema_refs: Vec<GtsRef>,
}Fields§
§gts_id: Option<GtsID>The GTS ID if the entity has one (either from id field for well-known instances,
or from $id field for schemas). None for anonymous instances.
instance_id: Option<String>The instance ID - for anonymous instances this is the UUID from id field,
for well-known instances this equals gts_id.id, for schemas this equals gts_id.id.
is_schema: boolTrue if this is a JSON Schema (has $schema field), false if it’s an instance.
file: Option<GtsFile>§list_sequence: Option<usize>§label: String§content: Value§gts_refs: Vec<GtsRef>§validation: ValidationResult§schema_id: Option<String>The schema ID that this entity conforms to:
- For schemas: the
$schemafield value (e.g.,http://json-schema.org/draft-07/schema#) OR for GTS schemas, the parent schema from the chain - For instances: the
typefield value (the GTS type ID ending with~)
selected_entity_field: Option<String>§selected_schema_id_field: Option<String>§description: String§schema_refs: Vec<GtsRef>Implementations§
Source§impl GtsEntity
impl GtsEntity
pub fn new( file: Option<GtsFile>, list_sequence: Option<usize>, content: &Value, cfg: Option<&GtsConfig>, gts_id: Option<GtsID>, is_schema: bool, label: String, validation: Option<ValidationResult>, schema_id: Option<String>, ) -> Self
pub fn resolve_path(&self, path: &str) -> JsonPathResolver
Sourcepub fn cast(
&self,
to_schema: &GtsEntity,
from_schema: &GtsEntity,
resolver: Option<&()>,
) -> Result<GtsEntityCastResult, SchemaCastError>
pub fn cast( &self, to_schema: &GtsEntity, from_schema: &GtsEntity, resolver: Option<&()>, ) -> Result<GtsEntityCastResult, SchemaCastError>
Sourcepub fn effective_id(&self) -> Option<String>
pub fn effective_id(&self) -> Option<String>
Returns the effective ID for this entity (for store indexing and CLI output).
- For schemas: the GTS ID from
$idfield - For well-known instances: the GTS ID from
idfield - For anonymous instances: the
instance_id(UUID or other non-GTS identifier)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GtsEntity
impl RefUnwindSafe for GtsEntity
impl Send for GtsEntity
impl Sync for GtsEntity
impl Unpin for GtsEntity
impl UnwindSafe for GtsEntity
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