pub trait ToJson {
// Required method
fn add_to_json_with(
&self,
value_map: &mut Map<String, Value>,
opts: ValueOptions,
);
// Provided method
fn to_json_with(&self, opts: ValueOptions) -> Value { ... }
}
Required Methods§
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Provided Methods§
fn to_json_with(&self, opts: ValueOptions) -> Value
Implementations on Foreign Types§
Source§impl ToJson for Annotation
impl ToJson for Annotation
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for ConstraintBody
impl ToJson for ConstraintBody
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for FunctionBody
impl ToJson for FunctionBody
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for FunctionTypeReference
impl ToJson for FunctionTypeReference
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for BooleanSentence
impl ToJson for BooleanSentence
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for ConstraintSentence
impl ToJson for ConstraintSentence
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for SimpleSentence
impl ToJson for SimpleSentence
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for Subject
impl ToJson for Subject
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for Term
impl ToJson for Term
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for PredicateSequenceMember
impl ToJson for PredicateSequenceMember
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for PredicateValue
impl ToJson for PredicateValue
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for TypeClassArgument
impl ToJson for TypeClassArgument
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for DimensionIdentity
impl ToJson for DimensionIdentity
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for Definition
impl ToJson for Definition
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for IdentifierReference
impl ToJson for IdentifierReference
fn to_json_with(&self, opts: ValueOptions) -> Value
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for MemberKind
impl ToJson for MemberKind
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for TypeReference
impl ToJson for TypeReference
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for Import
impl ToJson for Import
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for SequenceMember
impl ToJson for SequenceMember
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for SimpleValue
impl ToJson for SimpleValue
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for Value
Convert a SDML Value
into a context object, in the form shown as JSON below.
impl ToJson for Value
Convert a SDML Value
into a context object, in the form shown as JSON below.
§Simple Value
{
"__type": "boolean|double|decimal|integer|unsigned|string|uri|binary",
"value": ...
}
§Value Constructor
{
"__type": "constructor",
"type_ref": "IdentifierReference",
"value": {}
}
§Mapping
{
"__type": "mapping",
"domain": {},
"range": {}
}
§Reference
{
"__type": "type_ref",
"value": "IdentifierReference",
}
§Sequence
{
"__type": "sequence",
"members": []
}
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for AnnotationOnlyBody
impl ToJson for AnnotationOnlyBody
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for AnnotationProperty
Convert a SDML AnnotationProperty
into a context object, in the form shown as JSON below.
impl ToJson for AnnotationProperty
Convert a SDML AnnotationProperty
into a context object, in the form shown as JSON below.
{
"__type": "property",
"source_span": {}, // optional
"name": "IdentifierReference", // optional
"value": {}
}
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for FunctionCardinality
impl ToJson for FunctionCardinality
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for FunctionDef
impl ToJson for FunctionDef
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for FunctionParameter
impl ToJson for FunctionParameter
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for FunctionSignature
impl ToJson for FunctionSignature
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for FunctionType
impl ToJson for FunctionType
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for AtomicSentence
impl ToJson for AtomicSentence
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for BinaryBooleanSentence
impl ToJson for BinaryBooleanSentence
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for Equation
impl ToJson for Equation
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for Inequation
impl ToJson for Inequation
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for QuantifiedSentence
impl ToJson for QuantifiedSentence
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for QuantifiedVariable
impl ToJson for QuantifiedVariable
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for QuantifiedVariableBinding
impl ToJson for QuantifiedVariableBinding
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for UnaryBooleanSentence
impl ToJson for UnaryBooleanSentence
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for Variable
impl ToJson for Variable
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, _opts: ValueOptions, )
Source§impl ToJson for SequenceBuilder
impl ToJson for SequenceBuilder
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for FormalConstraint
impl ToJson for FormalConstraint
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for FunctionComposition
impl ToJson for FunctionComposition
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for FunctionalTerm
impl ToJson for FunctionalTerm
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for SequenceOfPredicateValues
impl ToJson for SequenceOfPredicateValues
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for ControlledLanguageString
impl ToJson for ControlledLanguageString
fn add_to_json_with(&self, value_map: &mut Map<String, Value>, _: ValueOptions)
Source§impl ToJson for Constraint
Convert a SDML Constraint
into a context object, in the form shown as JSON below.
impl ToJson for Constraint
Convert a SDML Constraint
into a context object, in the form shown as JSON below.
§Informal Constraint
{
"__type": "informal",
"source_span": {}, // optional
"name": "Identifier",
"value": "string",
"language": "" // optional
}
§Formal Constraint
{
"__type": "formal",
"source_span": {}, // optional
"name": "Identifier",
"definitions": [], // optional
"sentence": {}
}
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for MethodDef
impl ToJson for MethodDef
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for TypeClassBody
impl ToJson for TypeClassBody
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for TypeClassDef
Convert a SDML TypeClassDef
into a context object, in the form shown as JSON below.
impl ToJson for TypeClassDef
Convert a SDML TypeClassDef
into a context object, in the form shown as JSON below.
{
"__type": "type_class",
"source_span": {}, // optional
"name": "Identifier",
"variables": [], // optional
"methods": [], // optional
"annotations": [] // optional
}
§Variable
TBD
§Method
TBD
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for TypeClassReference
impl ToJson for TypeClassReference
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for TypeVariable
impl ToJson for TypeVariable
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for DatatypeDef
Convert a SDML DatatypeDef
into a context object, in the form shown as JSON below.
impl ToJson for DatatypeDef
Convert a SDML DatatypeDef
into a context object, in the form shown as JSON below.
{
"__type": "datatype",
"source_span": {}, // optional
"name": "Identifier",
"is_opaque": false,
"base_type": "IdentifierReference",
"annotations": [] // optional
}
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for DimensionBody
impl ToJson for DimensionBody
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for DimensionDef
Convert a SDML DimensionDef
into a context object, in the form shown as JSON below.
impl ToJson for DimensionDef
Convert a SDML DimensionDef
into a context object, in the form shown as JSON below.
{
"__type": "event",
"source_span": {}, // optional
"name": "Identifier",
"entity": {...}, // SourceEntity or Member
"parents": [], // optional
"members": [], // optional
"annotations": [] // optional
}
§DimensionParent
{
"source_span": {}, // optional
"name": "Identifier",
"entity": "IdentifierReference",
"annotations": [] // optional
}
§SourceEntity
{
"__type": "source_entity",
"source_span": {}, // optional
"entity": "IdentifierReference",
"members": [] // optional
}
For members
, see [member_to_value
].
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for DimensionParent
impl ToJson for DimensionParent
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for SourceEntity
impl ToJson for SourceEntity
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for EntityBody
impl ToJson for EntityBody
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for EntityDef
Convert a SDML EntityDef
into a context object, in the form shown as JSON below.
impl ToJson for EntityDef
Convert a SDML EntityDef
into a context object, in the form shown as JSON below.
{
"__type": "entity",
"source_span": {}, // optional
"name": "Identifier",
"identity": {},
"members": [], // optional
"annotations": [] // optional
}
For identity
, see MemberDef and for members
see Member, in [member_to_value
].
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for EnumBody
impl ToJson for EnumBody
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for EnumDef
Convert a SDML EnumDef
into a context object, in the form shown as JSON below.
impl ToJson for EnumDef
Convert a SDML EnumDef
into a context object, in the form shown as JSON below.
{
"__type": "enum",
"source_span": {}, // optional
"name": "Identifier",
"variants": [ // optional
{
"name": "Identifier",
"annotations": [] // optional
}
],
"annotations": [] // optional
}
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for ValueVariant
impl ToJson for ValueVariant
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for EventBody
impl ToJson for EventBody
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for EventDef
Convert a SDML EventDef
into a context object, in the form shown as JSON below.
impl ToJson for EventDef
Convert a SDML EventDef
into a context object, in the form shown as JSON below.
{
"__type": "event_def",
"source_span": {}, // optional
"name": "Identifier",
"source_entity": {}, // SourceEntity
"members": [], // optional
"annotations": [] // optional
}
For members
, see [member_to_value
], and for event_source
see [dimension_to_value
].
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for PropertyDef
Convert a SDML PropertyDef
into a context object, in the form shown as JSON below.
impl ToJson for PropertyDef
Convert a SDML PropertyDef
into a context object, in the form shown as JSON below.
{
"__type": "property",
"source_span": {}, // optional
"name": "Identifier",
"cardinality": {
"ordering": "",
"uniqueness": "",
"min_occurs": 1,
"max_occurs": 0 // optional
},
"type_ref": "IdentifierReference"
}
For member
see member definition in [member_to_value
].
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for RdfDef
Convert a SDML RdfDef
into a context object, in the form shown as JSON below.
impl ToJson for RdfDef
Convert a SDML RdfDef
into a context object, in the form shown as JSON below.
{
"__type": "rdf",
"source_span": {}, // optional
"name": "Identifier",
"annotations": [] // optional
}
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for StructureBody
impl ToJson for StructureBody
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for StructureDef
Convert a SDML StructureDef
into a context object, in the form shown as JSON below.
impl ToJson for StructureDef
Convert a SDML StructureDef
into a context object, in the form shown as JSON below.
{
"__type": "structure",
"source_span": {}, // optional
"name": "Identifier",
"members": [], // optional
"annotations": [] // optional
}
For members
, see [member_to_value
].
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for TypeVariant
impl ToJson for TypeVariant
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for UnionBody
impl ToJson for UnionBody
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for UnionDef
Convert a SDML UnionDef
into a context object, in the form shown as JSON below.
impl ToJson for UnionDef
Convert a SDML UnionDef
into a context object, in the form shown as JSON below.
{
"__type": "union",
"source_span": {}, // optional
"name": "Identifier",
"variants": [ // optional
{
"name": "IdentifierReference",
"rename": "Identifier",
"annotations": []
}
],
"annotations": [] // optional
}
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for Identifier
impl ToJson for Identifier
fn to_json_with(&self, opts: ValueOptions) -> Value
fn add_to_json_with(&self, value_map: &mut Map<String, Value>, _: ValueOptions)
Source§impl ToJson for QualifiedIdentifier
impl ToJson for QualifiedIdentifier
fn to_json_with(&self, opts: ValueOptions) -> Value
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for Cardinality
impl ToJson for Cardinality
fn add_to_json_with( &self, value_map: &mut Map<String, Value>, opts: ValueOptions, )
Source§impl ToJson for Member
Convert a SDML Member
into a context object, in the form shown as JSON below.
impl ToJson for Member
Convert a SDML Member
into a context object, in the form shown as JSON below.
A member is either a reference to a property or a definition of a new member.
§Property Reference
{
"__type": "reference",
"type_ref": "IdentifierReference",
}
§Member Definition
{
"__type": "definition",
"source_span": {}, // optional
"name": "Identifier",
"cardinality": {
"ordering": "",
"uniqueness": "",
"min_occurs": 1,
"max_occurs": 0 // optional
},
"type_ref": "IdentifierReference"
}