pub enum FormatOutput {
Text(String),
Value(Value),
Values(Vec<Value>),
}Expand description
Polymorphic return for the surface formatters.
Markdown / Skill / TableRow styles return Text; Json
returns Value (single module) or Values (module list).
Variants§
Implementations§
Source§impl FormatOutput
impl FormatOutput
Sourcepub fn as_str(&self) -> Option<&str>
pub fn as_str(&self) -> Option<&str>
Borrow as a string slice if this is a FormatOutput::Text.
Sourcepub fn as_value(&self) -> Option<&Value>
pub fn as_value(&self) -> Option<&Value>
Borrow as a single JSON value if this is a FormatOutput::Value.
Sourcepub fn as_values(&self) -> Option<&[Value]>
pub fn as_values(&self) -> Option<&[Value]>
Borrow as a JSON array if this is a FormatOutput::Values.
Trait Implementations§
Source§impl Clone for FormatOutput
impl Clone for FormatOutput
Source§fn clone(&self) -> FormatOutput
fn clone(&self) -> FormatOutput
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 moreAuto Trait Implementations§
impl Freeze for FormatOutput
impl RefUnwindSafe for FormatOutput
impl Send for FormatOutput
impl Sync for FormatOutput
impl Unpin for FormatOutput
impl UnsafeUnpin for FormatOutput
impl UnwindSafe for FormatOutput
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