Skip to main content

OptionData

Trait OptionData 

Source
pub trait OptionData<T> {
    // Required method
    fn data(self) -> Result<T>;
}
Expand description

Convert Option<T>Result<T> without panicking.

Replaces .unwrap() in query paths so a missing value returns HTTP 500 instead of crashing the server (panic = "abort").

Required Methods§

Source

fn data(self) -> Result<T>

Implementations on Foreign Types§

Source§

impl<T> OptionData<T> for Option<T>

Source§

fn data(self) -> Result<T>

Implementors§