Skip to main content

Result

Type Alias Result 

Source
pub type Result<T, E = Error<'static>> = Result<T, E>;
Expand description

Standard Result type for OSAL-RS operations.

Uses Error as the default error type with 'static lifetime. For custom lifetimes, use core::result::Result<T, Error<'a>>.

§Examples

use osal_rs::utils::Result;

fn create_resource() -> Result<ResourceHandle> {
    // Returns Result<ResourceHandle, Error<'static>>
    Ok(ResourceHandle::new())
}

Aliased Type§

pub enum Result<T, E = Error<'static>> {
    Ok(T),
    Err(E),
}

Variants§

§1.0.0

Ok(T)

Contains the success value

§1.0.0

Err(E)

Contains the error value