Trait OptionExt
Source pub trait OptionExt<T> {
Show 39 methods
// Required methods
fn ok_or_bad_request(self, context: &'static str) -> Result<T, StatusError>;
fn ok_or_unauthorized(self, context: &'static str) -> Result<T, StatusError>;
fn ok_or_payment_required(
self,
context: &'static str,
) -> Result<T, StatusError>;
fn ok_or_forbidden(self, context: &'static str) -> Result<T, StatusError>;
fn ok_or_not_found(self, context: &'static str) -> Result<T, StatusError>;
fn ok_or_method_not_allowed(
self,
context: &'static str,
) -> Result<T, StatusError>;
fn ok_or_not_acceptable(
self,
context: &'static str,
) -> Result<T, StatusError>;
fn ok_or_proxy_authentication_required(
self,
context: &'static str,
) -> Result<T, StatusError>;
fn ok_or_request_timeout(
self,
context: &'static str,
) -> Result<T, StatusError>;
fn ok_or_conflict(self, context: &'static str) -> Result<T, StatusError>;
fn ok_or_gone(self, context: &'static str) -> Result<T, StatusError>;
fn ok_or_length_required(
self,
context: &'static str,
) -> Result<T, StatusError>;
fn ok_or_precondition_failed(
self,
context: &'static str,
) -> Result<T, StatusError>;
fn ok_or_payload_too_large(
self,
context: &'static str,
) -> Result<T, StatusError>;
fn ok_or_uri_too_long(self, context: &'static str) -> Result<T, StatusError>;
fn ok_or_unsupported_media_type(
self,
context: &'static str,
) -> Result<T, StatusError>;
fn ok_or_range_not_satisfiable(
self,
context: &'static str,
) -> Result<T, StatusError>;
fn ok_or_expectation_failed(
self,
context: &'static str,
) -> Result<T, StatusError>;
fn ok_or_im_a_teapot(self, context: &'static str) -> Result<T, StatusError>;
fn ok_or_misdirected_request(
self,
context: &'static str,
) -> Result<T, StatusError>;
fn ok_or_unprocessable_entity(
self,
context: &'static str,
) -> Result<T, StatusError>;
fn ok_or_locked(self, context: &'static str) -> Result<T, StatusError>;
fn ok_or_failed_dependency(
self,
context: &'static str,
) -> Result<T, StatusError>;
fn ok_or_upgrade_required(
self,
context: &'static str,
) -> Result<T, StatusError>;
fn ok_or_precondition_required(
self,
context: &'static str,
) -> Result<T, StatusError>;
fn ok_or_too_many_requests(
self,
context: &'static str,
) -> Result<T, StatusError>;
fn ok_or_request_header_fields_too_large(
self,
context: &'static str,
) -> Result<T, StatusError>;
fn ok_or_unavailable_for_legal_reasons(
self,
context: &'static str,
) -> Result<T, StatusError>;
fn ok_or_internal_server_error(
self,
context: &'static str,
) -> Result<T, StatusError>;
fn ok_or_not_implemented(
self,
context: &'static str,
) -> Result<T, StatusError>;
fn ok_or_bad_gateway(self, context: &'static str) -> Result<T, StatusError>;
fn ok_or_service_unavailable(
self,
context: &'static str,
) -> Result<T, StatusError>;
fn ok_or_gateway_timeout(
self,
context: &'static str,
) -> Result<T, StatusError>;
fn ok_or_http_version_not_supported(
self,
context: &'static str,
) -> Result<T, StatusError>;
fn ok_or_variant_also_negotiates(
self,
context: &'static str,
) -> Result<T, StatusError>;
fn ok_or_insufficient_storage(
self,
context: &'static str,
) -> Result<T, StatusError>;
fn ok_or_loop_detected(
self,
context: &'static str,
) -> Result<T, StatusError>;
fn ok_or_not_extended(self, context: &'static str) -> Result<T, StatusError>;
fn ok_or_network_authentication_required(
self,
context: &'static str,
) -> Result<T, StatusError>;
}