Skip to main content

Result

Type Alias Result 

Source
pub type Result<T> = Result<T, ErrorCode>;

Aliased Type§

pub enum Result<T> {
    Ok(T),
    Err(ErrorCode),
}

Variants§

§1.0.0

Ok(T)

Contains the success value

§1.0.0

Err(ErrorCode)

Contains the error value

Trait Implementations§

Source§

impl<T> ApiResultExt for Result<T>

Source§

type Ok = T

Source§

fn into_ec(self) -> Result<T>

Source§

fn retryable(self) -> Result<Option<Self::Ok>, ErrorCode>

Turns retryable errors into None, and the Result into a std::result::Result, making the output suitable for use with crate::misc::task::retry.
Source§

fn into_server_result(self) -> Result<Self::Ok>

When passing along a result from another server to a client, this method is called to modify any ErrorCode. For details, see ErrorCode::into_server_error.
Source§

impl<T> ResultPayloadTrait for Result<T>

Source§

type OkType = T

Source§

fn from_ec(ec: ErrorCode) -> Self

Create an instance of this result payload type from the given ErrorCode infallibly.
Source§

fn into_result(self) -> Result<Self>

Destructs this payload result, extracting any error.
Source§

fn from_result(res: Result<Self>) -> Self