pub enum Error {
Show 15 variants
BlobWrongSize,
DataNotFound,
DecryptionError,
EOF(String),
InvalidColumnStorage(u8),
InvalidColumnType(u8),
IOError(Error),
MalformedHeader,
StringMalformed(Utf8Error),
OptionalColumnConflict(&'static str),
ValueConversion(&'static str, &'static str, Box<dyn Error>),
WrongColumnName(String, &'static str),
WrongColumnType(u8, u8),
WrongColumnStorage(u8, &'static str),
WrongTableSchema,
}
Expand description
Error returned when reading or writing a table fails
Variants§
BlobWrongSize
If a data blob is not the correct size
This is only used in the implementation of Value
for [u8; N]
DataNotFound
If a string or data blob is unable to be read from a table
This means the table is malformed
DecryptionError
If a UTF packet is unable to be decrypted
This means the table’s data is malformed
EOF(String)
If the entire content of the table is unable to be read from a stream
InvalidColumnStorage(u8)
If the flag associated with the column’s storage method is invalid (table is malformed)
InvalidColumnType(u8)
If the flag associated with the column’s data type is invalid (table is malformed)
IOError(Error)
If an I/O error happens
This does not include end-of-file errors. There’s a variant for that specifically.
MalformedHeader
Generic error for any malformed data in the header of a table
StringMalformed(Utf8Error)
If a string stored in a table is unable to be decoded
OptionalColumnConflict(&'static str)
Occurs when writing
For a rowed optional value, the value in each row must ALL either be
Some
or None
. If this condition is violated, this error is
returned.
ValueConversion(&'static str, &'static str, Box<dyn Error>)
If a conversion from a primitive to another value (or vice versa) fails
WrongColumnName(String, &'static str)
If the name of a column is not what was expected
This indicates the table doesn’t follow the expected schema. The table may still be perfectly valid.
WrongColumnType(u8, u8)
If the type of data stored in a column is not what was expected.
This indicates the table doesn’t follow the expected schema. The table may still be perfectly valid.
WrongColumnStorage(u8, &'static str)
If the method a column stores data is not what was expected
This indicates the table doesn’t follow the expected schema. The table may still be perfectly valid.
WrongTableSchema
Generic error for a table not following a schema. The table may still be valid.