pub struct VersionedErrorBuilder { /* private fields */ }
Expand description
Version-aware error builder
Implementations§
Source§impl VersionedErrorBuilder
impl VersionedErrorBuilder
Sourcepub fn status(self, status: ElifStatusCode) -> Self
pub fn status(self, status: ElifStatusCode) -> Self
Set status code
Sourcepub fn field_errors(self, field_errors: HashMap<String, Vec<String>>) -> Self
pub fn field_errors(self, field_errors: HashMap<String, Vec<String>>) -> Self
Add field errors for validation
Sourcepub fn field_error(self, field: &str, error: &str) -> Self
pub fn field_error(self, field: &str, error: &str) -> Self
Add a single field error
Sourcepub fn build(self, version_info: &VersionInfo) -> HttpResult<ElifResponse>
pub fn build(self, version_info: &VersionInfo) -> HttpResult<ElifResponse>
Build the error response with version information
Auto Trait Implementations§
impl Freeze for VersionedErrorBuilder
impl RefUnwindSafe for VersionedErrorBuilder
impl Send for VersionedErrorBuilder
impl Sync for VersionedErrorBuilder
impl Unpin for VersionedErrorBuilder
impl UnwindSafe for VersionedErrorBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more