pub struct ReadablePersonalOriginalIdentity { /* private fields */ }Expand description
An original identity whose source has been confirmed readable by the caller.
Implementations§
Source§impl ReadablePersonalOriginalIdentity
impl ReadablePersonalOriginalIdentity
Sourcepub fn assume_readable(identity: PersonalOriginalIdentity) -> Self
pub fn assume_readable(identity: PersonalOriginalIdentity) -> Self
Records caller- or backend-confirmed original identity facts as readable.
This performs no I/O. Callers use it to attest that the supplied identity describes an original that was readable through their chosen storage backend.
Sourcepub fn into_identity(self) -> PersonalOriginalIdentity
pub fn into_identity(self) -> PersonalOriginalIdentity
Consumes this readability wrapper and returns the underlying identity facts.
Sourcepub fn from_local_path(path: impl AsRef<Path>) -> Result<Self>
pub fn from_local_path(path: impl AsRef<Path>) -> Result<Self>
Opens a local original for reading and derives its identity facts.
This performs blocking filesystem I/O. Async applications should call it from a blocking adapter rather than directly on an async executor worker.
The cache URI identity is built from the caller-supplied absolute path bytes without resolving symlinks. Readability, modification time, and size are taken from opening and statting the referenced file target.
§Errors
Returns an error when the path is not absolute, the original cannot be opened for reading, metadata or modification time cannot be read, or the path cannot form a canonical local URI.
Sourcepub fn from_local_path_with_mime_type(
path: impl AsRef<Path>,
mime_type: impl Into<String>,
) -> Result<Self>
pub fn from_local_path_with_mime_type( path: impl AsRef<Path>, mime_type: impl Into<String>, ) -> Result<Self>
Opens a local original for reading and derives its identity facts with a MIME type.
This performs blocking filesystem I/O. Async applications should call it from a blocking adapter rather than directly on an async executor worker.
The cache URI identity is built from the caller-supplied absolute path bytes without resolving symlinks. Readability, modification time, and size are taken from opening and statting the referenced file target.
§Errors
Returns the same errors as Self::from_local_path and also rejects invalid MIME type
metadata.
Sourcepub const fn identity(&self) -> &PersonalOriginalIdentity
pub const fn identity(&self) -> &PersonalOriginalIdentity
Returns the readable identity facts.
Trait Implementations§
Source§impl Clone for ReadablePersonalOriginalIdentity
impl Clone for ReadablePersonalOriginalIdentity
Source§fn clone(&self) -> ReadablePersonalOriginalIdentity
fn clone(&self) -> ReadablePersonalOriginalIdentity
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl PartialEq for ReadablePersonalOriginalIdentity
impl PartialEq for ReadablePersonalOriginalIdentity
Source§fn eq(&self, other: &ReadablePersonalOriginalIdentity) -> bool
fn eq(&self, other: &ReadablePersonalOriginalIdentity) -> bool
self and other values to be equal, and is used by ==.impl Eq for ReadablePersonalOriginalIdentity
impl StructuralPartialEq for ReadablePersonalOriginalIdentity
Auto Trait Implementations§
impl Freeze for ReadablePersonalOriginalIdentity
impl RefUnwindSafe for ReadablePersonalOriginalIdentity
impl Send for ReadablePersonalOriginalIdentity
impl Sync for ReadablePersonalOriginalIdentity
impl Unpin for ReadablePersonalOriginalIdentity
impl UnsafeUnpin for ReadablePersonalOriginalIdentity
impl UnwindSafe for ReadablePersonalOriginalIdentity
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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