pub struct Context<'a> { /* private fields */ }Expand description
Shared request validation and metadata packet processing.
Implementations§
Source§impl<'a> Context<'a>
impl<'a> Context<'a>
Sourcepub fn new(request: &RewriteRequest<'a>) -> Result<Self, Error>
pub fn new(request: &RewriteRequest<'a>) -> Result<Self, Error>
Validate a metadata-only request before invoking a container walker.
Sourcepub fn check(&self) -> Result<(), Error>
pub fn check(&self) -> Result<(), Error>
Poll cancellation while preserving the caller’s stop reason.
Sourcepub fn packet(&self, size: usize) -> Result<(), Error>
pub fn packet(&self, size: usize) -> Result<(), Error>
Enforce the parsed/expanded packet or regenerated metadata budget.
Sourcepub fn with_input(self, input: &'a [u8]) -> Self
pub fn with_input(self, input: &'a [u8]) -> Self
Reuse the parent policy and limits for a contained image.
Sourcepub fn with_xmp_editing(self, enabled: bool) -> Self
pub fn with_xmp_editing(self, enabled: bool) -> Self
Override descriptive XMP handling for a contained image.
Sourcepub fn services(&self) -> Result<&dyn Services, Error>
pub fn services(&self) -> Result<&dyn Services, Error>
Require an application service provider.
Sourcepub fn xmp(&self, xml: &[u8]) -> Result<Option<Vec<u8>>, Error>
pub fn xmp(&self, xml: &[u8]) -> Result<Option<Vec<u8>>, Error>
Apply explicitly enabled descriptive XMP editing within packet limits.
Sourcepub fn icc(&self, bytes: &[u8]) -> Result<Option<Vec<u8>>, Error>
pub fn icc(&self, bytes: &[u8]) -> Result<Option<Vec<u8>>, Error>
Normalize a known ICC profile while retaining rendering dependencies.
Sourcepub fn decompress(
&self,
kind: Compression,
bytes: &[u8],
) -> Result<Vec<u8>, Error>
pub fn decompress( &self, kind: Compression, bytes: &[u8], ) -> Result<Vec<u8>, Error>
Expand a metadata packet through a bounded caller service.
Methods from Deref<Target = RewriteRequest<'a>>§
Sourcepub fn policy(&self) -> &MetadataPolicy
pub fn policy(&self) -> &MetadataPolicy
Retention policy.
Sourcepub fn normalize_icc(&self) -> bool
pub fn normalize_icc(&self) -> bool
Whether known ICC normalization is enabled.
Sourcepub fn remove_reconstruction(&self) -> bool
pub fn remove_reconstruction(&self) -> bool
Whether JPEG reconstruction data may be removed.
Sourcepub fn max_output(&self) -> usize
pub fn max_output(&self) -> usize
Maximum output bytes.
Sourcepub fn max_metadata(&self) -> usize
pub fn max_metadata(&self) -> usize
Maximum packet and regenerated metadata bytes.
Sourcepub fn max_carriers(&self) -> usize
pub fn max_carriers(&self) -> usize
Maximum reported carriers.