pub enum ByteaError {
InvalidInputSyntax,
InvalidHexDigit(char),
OddHexDigits,
}Expand description
Why byteain refuses a text, one variant per message it raises.
use sql_values::postgres::{ByteaError, PgBytea};
assert_eq!(PgBytea::parse(r"\x0"), Err(ByteaError::OddHexDigits));
assert_eq!(PgBytea::parse(r"\x0g"), Err(ByteaError::InvalidHexDigit('g')));
assert_eq!(PgBytea::parse(r"\9"), Err(ByteaError::InvalidInputSyntax));Variants§
InvalidInputSyntax
A backslash of the escape format not followed by \ or three octal digits up to \377.
InvalidHexDigit(char)
The first character of the hex format that is no digit and no whitespace between pairs.
OddHexDigits
Hex digits that end on half a byte.
Trait Implementations§
Source§impl Clone for ByteaError
impl Clone for ByteaError
impl Copy for ByteaError
Source§impl Debug for ByteaError
impl Debug for ByteaError
Source§impl Display for ByteaError
impl Display for ByteaError
impl Eq for ByteaError
Source§impl Error for ByteaError
impl Error for ByteaError
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 Hash for ByteaError
impl Hash for ByteaError
Source§impl PartialEq for ByteaError
impl PartialEq for ByteaError
impl StructuralPartialEq for ByteaError
Auto Trait Implementations§
impl Forget for ByteaError
impl Freeze for ByteaError
impl Move for ByteaError
impl RefUnwindSafe for ByteaError
impl Send for ByteaError
impl Sync for ByteaError
impl Unpin for ByteaError
impl UnsafeUnpin for ByteaError
impl UnwindSafe for ByteaError
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