SzResult

Type Alias SzResult 

Source
pub type SzResult<T> = Result<T, SzError>;
Expand description

Result type alias for Senzing SDK operations

This is the standard Result type used throughout the Senzing Rust SDK. All Senzing operations return SzResult<T> instead of Result<T, SzError>.

§Examples

use sz_rust_sdk::error::SzResult;

fn senzing_operation() -> SzResult<String> {
    // Your Senzing operation here
    Ok("Success".to_string())
}

Aliased Type§

pub enum SzResult<T> {
    Ok(T),
    Err(SzError),
}

Variants§

§1.0.0

Ok(T)

Contains the success value

§1.0.0

Err(SzError)

Contains the error value

Trait Implementations§

Source§

impl<T> SzResultExt<T> for SzResult<T>

Source§

fn or_retry<F>(self, f: F) -> SzResult<T>
where F: FnOnce(SzError) -> SzResult<T>,

If the error is retryable, call the provided closure; otherwise propagate the error. Read more
Source§

fn map_retryable<F>(self, f: F) -> SzResult<T>
where F: FnOnce(SzError) -> SzResult<T>,

Maps retryable errors using the provided function, propagates non-retryable errors. Read more
Source§

fn filter_retryable(self) -> Result<Option<T>, SzError>

Returns Ok(None) for retryable errors, Err for non-retryable errors. Read more
Source§

fn is_retryable_error(&self) -> bool

Returns true if the result is an error and that error is retryable
Source§

fn is_unrecoverable_error(&self) -> bool

Returns true if the result is an error and that error is unrecoverable
Source§

fn is_bad_input_error(&self) -> bool

Returns true if the result is an error and that error is bad input