Skip to main content

Result

Type Alias Result 

Source
pub type Result<T, E = BaseError> = Result<T, E>;
Expand description

以 BaseError 为默认错误类型的统一 Result 别名。

允许下游以 yang_base::Result<T> 书写返回类型,省去重复的 , BaseError。 保留类型参数 E = BaseError,少数需要其它错误类型的签名仍可显式覆盖。

Aliased Type§

pub enum Result<T, E = BaseError> {
    Ok(T),
    Err(E),
}

Variants§

§1.0.0

Ok(T)

Contains the success value

§1.0.0

Err(E)

Contains the error value