pub struct FactContent {
pub kind: FactContentKind,
pub content: String,
pub structured: Option<Value>,
}Expand description
Content of a promoted fact.
Fields§
§kind: FactContentKindWhat kind of content this is
content: StringThe textual content
structured: Option<Value>Structured content (if applicable)
Implementations§
Source§impl FactContent
impl FactContent
Sourcepub fn new(kind: FactContentKind, content: impl Into<String>) -> FactContent
pub fn new(kind: FactContentKind, content: impl Into<String>) -> FactContent
Create new fact content.
Sourcepub fn with_structured(self, structured: Value) -> FactContent
pub fn with_structured(self, structured: Value) -> FactContent
Add structured content.
Trait Implementations§
Source§impl Clone for FactContent
impl Clone for FactContent
Source§fn clone(&self) -> FactContent
fn clone(&self) -> FactContent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FactContent
impl Debug for FactContent
Source§impl<'de> Deserialize<'de> for FactContent
impl<'de> Deserialize<'de> for FactContent
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<FactContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<FactContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for FactContent
impl Serialize for FactContent
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for FactContent
impl RefUnwindSafe for FactContent
impl Send for FactContent
impl Sync for FactContent
impl Unpin for FactContent
impl UnsafeUnpin for FactContent
impl UnwindSafe for FactContent
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