pub struct ByteRange { /* private fields */ }Expand description
Represents a byte range in a PDF document for signature calculation
ByteRange is used to specify which parts of the PDF are covered by the signature. It typically consists of two ranges:
- From document start to before the /Contents value
- From after the /Contents value to document end
Implementations§
Source§impl ByteRange
impl ByteRange
Sourcepub fn new(ranges: Vec<(u64, u64)>) -> Self
pub fn new(ranges: Vec<(u64, u64)>) -> Self
Creates a new ByteRange from a list of (offset, length) pairs
Sourcepub fn from_array(values: &[i64]) -> Result<Self, String>
pub fn from_array(values: &[i64]) -> Result<Self, String>
Creates a ByteRange from a PDF array [offset1 len1 offset2 len2 …]
Sourcepub fn total_bytes(&self) -> u64
pub fn total_bytes(&self) -> u64
Calculates the total number of bytes covered by all ranges
Trait Implementations§
impl Eq for ByteRange
impl StructuralPartialEq for ByteRange
Auto Trait Implementations§
impl Freeze for ByteRange
impl RefUnwindSafe for ByteRange
impl Send for ByteRange
impl Sync for ByteRange
impl Unpin for ByteRange
impl UnsafeUnpin for ByteRange
impl UnwindSafe for ByteRange
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more