pub struct EvalOutput {
pub format: String,
pub text: String,
}Expand description
What an evaluator returns: a format tag and the text it produced. plain
(or empty) renders as a text block; gemtext / markdown / djot are
nested-rendered through the registry.
Fields§
§format: String§text: StringImplementations§
Source§impl EvalOutput
impl EvalOutput
Sourcepub fn plain(text: impl Into<String>) -> Self
pub fn plain(text: impl Into<String>) -> Self
Plain-text output (the default when a script returns a single value).
Sourcepub fn detect(text: impl Into<String>) -> Self
pub fn detect(text: impl Into<String>) -> Self
Classify a plain-text result by a cheap leading-marker heuristic: a
gemtext heading (#/##) or link (=>) line tags it gemtext so it
nested-renders; otherwise plain. A convenience for backends without a
richer format-declaration convention (a script that wants to be
explicit returns an EvalOutput directly).
Trait Implementations§
Source§impl Clone for EvalOutput
impl Clone for EvalOutput
Source§fn clone(&self) -> EvalOutput
fn clone(&self) -> EvalOutput
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 EvalOutput
impl Debug for EvalOutput
impl Eq for EvalOutput
Source§impl PartialEq for EvalOutput
impl PartialEq for EvalOutput
impl StructuralPartialEq for EvalOutput
Auto Trait Implementations§
impl Freeze for EvalOutput
impl RefUnwindSafe for EvalOutput
impl Send for EvalOutput
impl Sync for EvalOutput
impl Unpin for EvalOutput
impl UnsafeUnpin for EvalOutput
impl UnwindSafe for EvalOutput
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.