pub struct SchemaOrg {
pub schema_type: String,
pub value: Value,
}Expand description
Schema.org structured data item.
Schema.org provides a collection of shared vocabularies that webmasters can use to mark up their pages in ways that can be understood by major search engines.
Fields§
§schema_type: StringThe @type of the schema (e.g., “Article”, “Product”, “Organization”)
value: ValueThe full JSON-LD value containing all properties
Implementations§
Source§impl SchemaOrg
impl SchemaOrg
Sourcepub fn parse(content: &str) -> Vec<Self>
pub fn parse(content: &str) -> Vec<Self>
Parse Schema.org data from a JSON-LD string.
Returns a vector of SchemaOrg items found in the JSON-LD content. Handles both single objects and arrays, as well as @graph structures.
Sourcepub fn get_str(&self, key: &str) -> Option<&str>
pub fn get_str(&self, key: &str) -> Option<&str>
Get a property value from the schema as a string.
Sourcepub fn get_i64(&self, key: &str) -> Option<i64>
pub fn get_i64(&self, key: &str) -> Option<i64>
Get a property value from the schema as an i64.
Sourcepub fn get_object(&self, key: &str) -> Option<&Value>
pub fn get_object(&self, key: &str) -> Option<&Value>
Get a property value from the schema as a nested object.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SchemaOrg
impl<'de> Deserialize<'de> for SchemaOrg
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SchemaOrg
impl RefUnwindSafe for SchemaOrg
impl Send for SchemaOrg
impl Sync for SchemaOrg
impl Unpin for SchemaOrg
impl UnwindSafe for SchemaOrg
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