Skip to main content

Context

Struct Context 

Source
pub struct Context<'a> { /* private fields */ }
Expand description

Shared request validation and metadata packet processing.

Implementations§

Source§

impl<'a> Context<'a>

Source

pub fn new(request: &RewriteRequest<'a>) -> Result<Self, Error>

Validate a metadata-only request before invoking a container walker.

Source

pub fn check(&self) -> Result<(), Error>

Poll cancellation while preserving the caller’s stop reason.

Source

pub fn packet(&self, size: usize) -> Result<(), Error>

Enforce the parsed/expanded packet or regenerated metadata budget.

Source

pub fn with_input(self, input: &'a [u8]) -> Self

Reuse the parent policy and limits for a contained image.

Source

pub fn with_xmp_editing(self, enabled: bool) -> Self

Override descriptive XMP handling for a contained image.

Source

pub fn services(&self) -> Result<&dyn Services, Error>

Require an application service provider.

Source

pub fn xmp(&self, xml: &[u8]) -> Result<Option<Vec<u8>>, Error>

Apply explicitly enabled descriptive XMP editing within packet limits.

Source

pub fn icc(&self, bytes: &[u8]) -> Result<Option<Vec<u8>>, Error>

Normalize a known ICC profile while retaining rendering dependencies.

Source

pub fn decompress( &self, kind: Compression, bytes: &[u8], ) -> Result<Vec<u8>, Error>

Expand a metadata packet through a bounded caller service.

Source

pub fn exif(&self, bytes: &[u8]) -> Result<Vec<u8>, Error>

Validate and filter EXIF while preserving orientation.

Methods from Deref<Target = RewriteRequest<'a>>§

Source

pub fn input(&self) -> &'a [u8] ⓘ

Encoded source bytes.

Source

pub fn policy(&self) -> &MetadataPolicy

Retention policy.

Source

pub fn services(&self) -> Option<&'a dyn Services>

Optional application services.

Source

pub fn edit_xmp(&self) -> bool

Whether descriptive XMP editing is enabled.

Source

pub fn normalize_icc(&self) -> bool

Whether known ICC normalization is enabled.

Source

pub fn remove_reconstruction(&self) -> bool

Whether JPEG reconstruction data may be removed.

Source

pub fn max_input(&self) -> usize

Maximum input bytes.

Source

pub fn max_output(&self) -> usize

Maximum output bytes.

Source

pub fn max_metadata(&self) -> usize

Maximum packet and regenerated metadata bytes.

Source

pub fn max_carriers(&self) -> usize

Maximum reported carriers.

Source

pub fn pulse(&self) -> Option<&'a dyn Pulse>

Caller pulse token.

Trait Implementations§

Source§

impl<'a> Clone for Context<'a>

Source§

fn clone(&self) -> Context<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Deref for Context<'a>

Source§

type Target = RewriteRequest<'a>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Context<'a>

§

impl<'a> !Send for Context<'a>

§

impl<'a> !Sync for Context<'a>

§

impl<'a> !UnwindSafe for Context<'a>

§

impl<'a> Freeze for Context<'a>

§

impl<'a> Unpin for Context<'a>

§

impl<'a> UnsafeUnpin for Context<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.