Enum FormatError
#[non_exhaustive]pub enum FormatError {
Truncated {
len: usize,
},
Magic {
found: u32,
},
Version(u8),
Crc {
stored: u32,
computed: u32,
},
Field {
name: &'static str,
value: u64,
},
UnusedRecord,
VolumeName,
DuplicateName {
first: u32,
second: u32,
},
MultipleAutoresize {
first: u32,
second: u32,
},
}Expand description
Invalid UBI header or volume table record.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Truncated
The data ends before the end of the header.
Magic
The header doesn’t start with the magic number of its type.
Version(u8)
The header has a version this crate doesn’t know.
Crc
A stored CRC doesn’t match the data it covers.
Field
A field has a value that the kernel rejects.
Fields
UnusedRecord
A volume table record without reserved blocks has other fields set.
VolumeName
The volume name is invalid. The kernel accepts 1 to 127 bytes without a NUL byte, followed by a NUL byte.
DuplicateName
A volume in the volume table has the name of an earlier volume.
MultipleAutoresize
A volume table has more than one volume with the autoresize flag.
Trait Implementations§
§impl Clone for FormatError
impl Clone for FormatError
§fn clone(&self) -> FormatError
fn clone(&self) -> FormatError
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 more§impl Debug for FormatError
impl Debug for FormatError
§impl Display for FormatError
impl Display for FormatError
impl Eq for FormatError
§impl Error for FormatError
impl Error for FormatError
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()
§impl PartialEq for FormatError
impl PartialEq for FormatError
impl StructuralPartialEq for FormatError
Auto Trait Implementations§
impl Freeze for FormatError
impl RefUnwindSafe for FormatError
impl Send for FormatError
impl Sync for FormatError
impl Unpin for FormatError
impl UnsafeUnpin for FormatError
impl UnwindSafe for FormatError
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