Type Alias SourceResult

Source
pub type SourceResult<T> = Result<T, EcoVec<SourceDiagnostic>>;
Expand description

A result that can carry multiple source errors.

Aliased Type§

pub enum SourceResult<T> {
    Ok(T),
    Err(EcoVec<SourceDiagnostic>),
}

Variants§

§1.0.0

Ok(T)

Contains the success value

§1.0.0

Err(EcoVec<SourceDiagnostic>)

Contains the error value

Trait Implementations§

Source§

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

Source§

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

Cast this type into a value.
Source§

impl<T: Reflect> Reflect for SourceResult<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
Source§

impl<T> Trace<T> for SourceResult<T>

Source§

fn trace<F>( self, world: Tracked<'_, dyn World + '_>, make_point: F, span: Span, ) -> Self
where F: Fn() -> Tracepoint,

Add the tracepoint to all errors that lie outside the span.