#[non_exhaustive]pub enum Position {
FileOffset(u64),
Object(u32),
InStream {
object: u32,
offset: u64,
},
}Expand description
Where an error was found, tagged so that a number has one meaning (ADR 0026 §1.1).
The syntax layer only sees the buffer it was given, and reports positions in it as
Position::FileOffset. A layer that hands it something other than the whole file
re-tags them when it wraps the error: Position::shifted for a window of the file,
Position::in_stream for an object stream’s decoded data. laminapdf-cos does both.
Added in 0.2.0.
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.
FileOffset(u64)
A byte offset in the input file.
Object(u32)
The indirect object with this number (e.g. where a reference chain got too long).
InStream
A byte offset in the decoded data of stream object (an object stream’s contents).
Implementations§
Source§impl Position
impl Position
Sourcepub fn offset(offset: usize) -> Self
pub fn offset(offset: usize) -> Self
A Position::FileOffset from a buffer offset (saturating; offsets fit in u64).
Added in 0.2.0.
Trait Implementations§
impl Copy for Position
impl Eq for Position
impl StructuralPartialEq for Position
Auto Trait Implementations§
impl Forget for Position
impl Freeze for Position
impl Move for Position
impl RefUnwindSafe for Position
impl Send for Position
impl Sync for Position
impl Unpin for Position
impl UnsafeUnpin for Position
impl UnwindSafe for Position
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