pub enum AdsContent {
Text(String),
List(Vec<String>),
}Expand description
Rendered content of an ADS section.
Variants§
Text(String)
A single prose value (block scalar).
List(Vec<String>)
A list of values (blind spots, response steps, tags).
Implementations§
Source§impl AdsContent
impl AdsContent
Sourcepub fn items(&self) -> Vec<String>
pub fn items(&self) -> Vec<String>
The list items, treating a single text value as a one-element list.
Sourcepub fn from_yaml(v: &Value) -> Option<AdsContent>
pub fn from_yaml(v: &Value) -> Option<AdsContent>
Render a YAML custom-attribute value as section content, or None when
it is blank or not a scalar (or sequence of scalars).
Sourcepub fn from_json(v: &Value) -> Option<AdsContent>
pub fn from_json(v: &Value) -> Option<AdsContent>
Render a JSON custom-attribute value as section content, matching
AdsContent::from_yaml’s scalar and sequence handling.
Trait Implementations§
Source§impl Clone for AdsContent
impl Clone for AdsContent
Source§fn clone(&self) -> AdsContent
fn clone(&self) -> AdsContent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 AdsContent
impl Debug for AdsContent
impl Eq for AdsContent
Source§impl PartialEq for AdsContent
impl PartialEq for AdsContent
Source§impl Serialize for AdsContent
impl Serialize for AdsContent
impl StructuralPartialEq for AdsContent
Auto Trait Implementations§
impl Freeze for AdsContent
impl RefUnwindSafe for AdsContent
impl Send for AdsContent
impl Sync for AdsContent
impl Unpin for AdsContent
impl UnsafeUnpin for AdsContent
impl UnwindSafe for AdsContent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.