Type Alias HintedStrResult

Source
pub type HintedStrResult<T> = Result<T, HintedString>;
Expand description

A result type with a string error message and hints.

Aliased Type§

enum HintedStrResult<T> {
    Ok(T),
    Err(HintedString),
}

Variants§

§1.0.0

Ok(T)

Contains the success value

§1.0.0

Err(HintedString)

Contains the error value

Trait Implementations§

Source§

impl<T> At<T> for HintedStrResult<T>

Source§

fn at(self, span: Span) -> SourceResult<T>

Add the span information.
Source§

impl<T> Hint<T> for HintedStrResult<T>

Source§

fn hint(self, hint: impl Into<EcoString>) -> HintedStrResult<T>

Add the hint.
Source§

impl<T: IntoValue> IntoResult for HintedStrResult<T>

Source§

fn into_result(self, span: Span) -> SourceResult<Value>

Cast this type into a value.
Source§

impl<T: Reflect> Reflect for HintedStrResult<T>

Source§

fn input() -> CastInfo

Describe what can be cast into this value.
Source§

fn output() -> CastInfo

Describe what this value can be cast into.
Source§

fn castable(value: &Value) -> bool

Whether the given value can be converted to T. Read more
Source§

fn error(found: &Value) -> HintedString

Produce an error message for an unacceptable value type. Read more