pub struct Bytes<'a> { /* private fields */ }Expand description
Original encoded body and its exact source location. This is an inspection input, not an assertion that its enclosing PDF object or signature is valid.
Implementations§
Source§impl<'a> Bytes<'a>
impl<'a> Bytes<'a>
Sourcepub fn new(raw: &'a [u8], form: Form, location: Location) -> Result<Self>
pub fn new(raw: &'a [u8], form: Form, location: Location) -> Result<Self>
Associates an original body with an equal-length source range without traversal or allocation. Syntax is checked by the paid decoding methods.
Sourcepub fn as_bytes(self) -> &'a [u8] ⓘ
pub fn as_bytes(self) -> &'a [u8] ⓘ
Unmodified original body, not a decoded or re-encoded signature input.
Sourcepub fn decode_in<W: Work>(self, work: &W) -> Result<OwnedVec<u8, W>>
pub fn decode_in<W: Work>(self, work: &W) -> Result<OwnedVec<u8, W>>
Decodes under the current work/account. Actual allocated capacity stays charged for the returned owner’s lifetime; refusal drops partial output.
Sourcepub fn matches_in(self, other: Self, work: &impl Work) -> Result<bool>
pub fn matches_in(self, other: Self, work: &impl Work) -> Result<bool>
Streaming decoded equality, without a scratch allocation or an
infallible PartialEq traversal. Each original byte is paid before read.
Sourcepub fn compare_in(self, other: Self, work: &impl Work) -> Result<Ordering>
pub fn compare_in(self, other: Self, work: &impl Work) -> Result<Ordering>
Lexicographic decoded byte order, using the same streaming kernel as equality. Neither case folding nor text normalization is performed.