StructuredData class
Structured data block (JSON-LD, Microdata, or RDFa).
Represents machine-readable structured data found in the document. JSON-LD blocks are collected as raw JSON strings for flexibility.
Examples
let schema = StructuredData {
data_type: StructuredDataType::JsonLd,
raw_json: r#"{"@context":"https://schema.org","@type":"Article"}"#.to_string(),
schema_type: Some("Article".to_string()),
};
assert_eq!(schema.data_type, StructuredDataType::JsonLd);
Constructors
- StructuredData({required StructuredDataType dataType, required String rawJson, String? schemaType})
-
const
Properties
- dataType → StructuredDataType
-
Type of structured data (JSON-LD, Microdata, RDFa)
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- rawJson → String
-
Raw JSON string (for JSON-LD) or serialized representation
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- schemaType → String?
-
Schema type if detectable (e.g., "Article", "Event", "Product")
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override