pub enum BodyCaptureError {
InvalidTotalLength {
captured: usize,
total: usize,
},
}Expand description
Reports inconsistent source-length metadata for a body capture.
§Examples
use qubit_redact::formats::http::BodyCapture;
use qubit_redact::formats::http::BodyCaptureError;
let error = BodyCapture::truncated(b"prefix", 3)
.expect_err("the claimed total must exceed captured bytes");
assert!(matches!(error, BodyCaptureError::InvalidTotalLength { .. }));Variants§
InvalidTotalLength
A truncated capture claimed a total no larger than captured bytes.
Trait Implementations§
Source§impl Clone for BodyCaptureError
impl Clone for BodyCaptureError
Source§fn clone(&self) -> BodyCaptureError
fn clone(&self) -> BodyCaptureError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for BodyCaptureError
Source§impl Debug for BodyCaptureError
impl Debug for BodyCaptureError
Source§impl Display for BodyCaptureError
impl Display for BodyCaptureError
Source§fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
Writes a concise description of the invalid capture metadata.
§Parameters
formatter- Destination formatting context.
§Returns
The formatter result from writing the error description.
§Errors
Returns fmt::Error when the destination rejects a write.
impl Eq for BodyCaptureError
Source§impl Error for BodyCaptureError
impl Error for BodyCaptureError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for BodyCaptureError
impl PartialEq for BodyCaptureError
impl StructuralPartialEq for BodyCaptureError
Auto Trait Implementations§
impl Freeze for BodyCaptureError
impl RefUnwindSafe for BodyCaptureError
impl Send for BodyCaptureError
impl Sync for BodyCaptureError
impl Unpin for BodyCaptureError
impl UnsafeUnpin for BodyCaptureError
impl UnwindSafe for BodyCaptureError
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