Skip to main content

SharedRepositoryContext

Struct SharedRepositoryContext 

Source
pub struct SharedRepositoryContext { /* private fields */ }
Expand description

Explicit context for read-only shared repository lookup.

Implementations§

Source§

impl SharedRepositoryContext

Source

pub fn lookup_thumbnail_path( &self, original_facts: SharedOriginalFacts, size: ThumbnailSize, ) -> Result<SharedThumbnailLookup<ThumbnailPathLookupEntry>>

Returns a validated shared-repository path for integrations that must pass a filename.

§Errors

Returns an error for unexpected filesystem I/O while reading the candidate or for PNG metadata parse failures after validation succeeds.

Source

pub fn lookup_thumbnail_png_bytes( &self, original_facts: SharedOriginalFacts, size: ThumbnailSize, ) -> Result<SharedThumbnailLookup<ThumbnailPngBytesLookupEntry>>

Returns exact validated PNG bytes from a shared thumbnail repository.

§Errors

Returns an error for unexpected filesystem I/O while reading the candidate or for PNG metadata parse failures after validation succeeds.

Source

pub fn lookup_thumbnail_rgba8( &self, original_facts: SharedOriginalFacts, size: ThumbnailSize, ) -> Result<SharedThumbnailLookup<ThumbnailRgba8LookupEntry>>

Returns decoded tightly packed RGBA8 pixels from a shared thumbnail repository.

The returned pixels are row-major [red, green, blue, alpha] bytes with straight alpha and stride == width * 4.

§Errors

Returns an error for unexpected filesystem I/O while reading the candidate or for PNG decoding failures after validation succeeds.

Source

pub fn lookup_display_thumbnail_rgba8( &self, original_facts: SharedOriginalFacts, size: ThumbnailSize, ) -> Result<SharedThumbnailLookup<DisplayThumbnailRgba8LookupEntry>>

Returns decoded RGBA8 display pixels, falling back to larger shared-repository namespaces.

The exact namespace is checked first. If it is missing, larger namespaces are checked in ascending order. The first non-missing candidate controls the result.

§Errors

Returns an error for unexpected filesystem I/O while reading the candidate or for PNG decoding failures after validation succeeds.

Source

pub fn inspect_thumbnails( &self, sizes: &[ThumbnailSize], original: SharedOriginalMetadata, ) -> Result<Vec<SharedCacheEntryInspection>>

Inspects existing shared-repository thumbnails without exposing removal handles.

§Errors

Returns an error when a selected shared thumbnail cannot be inspected due to unexpected filesystem I/O.

Source§

impl SharedRepositoryContext

Source

pub fn new( repository_root: impl AsRef<Path>, original_child_name: impl AsRef<OsStr>, ) -> Result<Self>

Creates a shared repository context for one direct child of repository_root.

§Errors

Returns an error when repository_root is not absolute or original_child_name cannot be represented as a shared direct-child URI identity.

Source

pub fn repository_root(&self) -> &Path

Returns the shared repository root directory.

Source

pub fn original_child_name(&self) -> &OsStr

Returns the direct child original filename.

Source

pub const fn shared_uri(&self) -> &SharedRelativeOriginalUri

Returns the shared URI used for hashing and optional metadata comparison.

Source

pub fn cache_entry_path(&self, size: ThumbnailSize) -> PathBuf

Computes the shared repository cache entry path for a successful thumbnail size.

Trait Implementations§

Source§

impl Clone for SharedRepositoryContext

Source§

fn clone(&self) -> SharedRepositoryContext

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 Debug for SharedRepositoryContext

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for SharedRepositoryContext

Source§

fn eq(&self, other: &SharedRepositoryContext) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for SharedRepositoryContext

Source§

impl StructuralPartialEq for SharedRepositoryContext

Auto Trait Implementations§

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<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.