pub struct Reader { /* private fields */ }Expand description
Use a Reader to read and validate a manifest store.
Implementations§
Source§impl Reader
impl Reader
Sourcepub fn from_context(context: Context) -> Self
pub fn from_context(context: Context) -> Self
Create a new Reader with the given Context.
This method takes ownership of the Context and wraps it in an Arc internally.
Use this for single-use contexts where you don’t need to share the context.
§Arguments
context- TheContextto use for the Reader
§Returns
A new Reader
§Examples
let context = Context::new().with_settings(r#"{"verify": {"verify_after_sign": true}}"#)?;
let reader = Reader::from_context(context);Create a new Reader with a shared Context.
This method allows sharing a single Context across multiple builders or readers,
even across threads. The Arc is cloned internally, so you pass a reference.
§Arguments
context- A reference to anArc<Context>to share.
§Returns
A new Reader
§Examples
// Create a shared Context once
let ctx = Arc::new(Context::new().with_settings(r#"{"verify": {"verify_after_sign": true}}"#)?);
// Share it across multiple Readers (even across threads!)
let reader1 = Reader::from_shared_context(&ctx);
let reader2 = Reader::from_shared_context(&ctx);Sourcepub fn with_stream(
self,
format: &str,
stream: impl Read + Seek + MaybeSend,
) -> Result<Self>
pub fn with_stream( self, format: &str, stream: impl Read + Seek + MaybeSend, ) -> Result<Self>
Sourcepub async fn with_stream_async(
self,
format: &str,
stream: impl Read + Seek + MaybeSend,
) -> Result<Self>
pub async fn with_stream_async( self, format: &str, stream: impl Read + Seek + MaybeSend, ) -> Result<Self>
Sourcepub fn from_stream(
format: &str,
stream: impl Read + Seek + MaybeSend,
) -> Result<Reader>
pub fn from_stream( format: &str, stream: impl Read + Seek + MaybeSend, ) -> Result<Reader>
Create a manifest store Reader from a stream. A Reader is used to validate C2PA data from an asset.
§Arguments
format- The format of the stream. MIME type or extension that maps to a MIME type.stream- The stream to read from. Must implement the Read and Seek traits. Send trait is required for sync operations and Sync trait is required for async operations.
§Returns
A Reader for the manifest store.
§Note
CAWG identity assertions require async calls for validation.
Sourcepub async fn from_stream_async(
format: &str,
stream: impl Read + Seek + MaybeSend,
) -> Result<Reader>
pub async fn from_stream_async( format: &str, stream: impl Read + Seek + MaybeSend, ) -> Result<Reader>
Create a manifest store Reader from a stream. A Reader is used to validate C2PA data from an asset.
§Arguments
format- The format of the stream. MIME type or extension that maps to a MIME type.stream- The stream to read from. Must implement the Read and Seek traits. Send trait is required for sync operations and Sync trait is required for async operations.
§Returns
A Reader for the manifest store.
§Note
CAWG identity assertions require async calls for validation.
Sourcepub fn with_file<P: AsRef<Path>>(self, path: P) -> Result<Self>
pub fn with_file<P: AsRef<Path>>(self, path: P) -> Result<Self>
Add manifest store from a file to the Reader.
If the fetch_remote_manifests feature is enabled, and the asset refers to a remote manifest, the function fetches a remote manifest.
NOTE: If the file does not have a manifest store, the function will check for a sidecar manifest with the same base file name and a .c2pa extension.
§Arguments
path- The path to the file.
§Returns
The updated Reader with the added manifest store.
§Errors
Returns an Error when the manifest data cannot be read from the specified file. If there’s no error upon reading, you must still check validation status to ensure that the manifest data is validated. That is, even if there are no errors, the data still might not be valid.
§Example
use c2pa::{Context, Reader};
let reader = Reader::from_context(Context::new()).with_file("path/to/file.jpg")?;§Note
CAWG identity assertions require async calls for validation.
Sourcepub async fn with_file_async<P: AsRef<Path>>(self, path: P) -> Result<Self>
pub async fn with_file_async<P: AsRef<Path>>(self, path: P) -> Result<Self>
Add manifest store from a file to the Reader.
If the fetch_remote_manifests feature is enabled, and the asset refers to a remote manifest, the function fetches a remote manifest.
NOTE: If the file does not have a manifest store, the function will check for a sidecar manifest with the same base file name and a .c2pa extension.
§Arguments
path- The path to the file.
§Returns
The updated Reader with the added manifest store.
§Errors
Returns an Error when the manifest data cannot be read from the specified file. If there’s no error upon reading, you must still check validation status to ensure that the manifest data is validated. That is, even if there are no errors, the data still might not be valid.
§Example
use c2pa::{Context, Reader};
let reader = Reader::from_context(Context::new()).with_file("path/to/file.jpg")?;§Note
CAWG identity assertions require async calls for validation.
Sourcepub fn from_file<P: AsRef<Path>>(path: P) -> Result<Reader>
pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Reader>
Create a manifest store Reader from a file.
If the fetch_remote_manifests feature is enabled, and the asset refers to a remote manifest, the function fetches a remote manifest.
NOTE: If the file does not have a manifest store, the function will check for a sidecar manifest with the same base file name and a .c2pa extension.
§Arguments
path- The path to the file.
§Returns
A Reader for the manifest store.
§Errors
Returns an Error when the manifest data cannot be read from the specified file. If there’s no error upon reading, you must still check validation status to ensure that the manifest data is validated. That is, even if there are no errors, the data still might not be valid.
§Example
use c2pa::Reader;
let reader = Reader::from_file("path/to/file.jpg").unwrap();§Note
CAWG identity assertions require async calls for validation.
Sourcepub async fn from_file_async<P: AsRef<Path>>(path: P) -> Result<Reader>
pub async fn from_file_async<P: AsRef<Path>>(path: P) -> Result<Reader>
Create a manifest store Reader from a file.
If the fetch_remote_manifests feature is enabled, and the asset refers to a remote manifest, the function fetches a remote manifest.
NOTE: If the file does not have a manifest store, the function will check for a sidecar manifest with the same base file name and a .c2pa extension.
§Arguments
path- The path to the file.
§Returns
A Reader for the manifest store.
§Errors
Returns an Error when the manifest data cannot be read from the specified file. If there’s no error upon reading, you must still check validation status to ensure that the manifest data is validated. That is, even if there are no errors, the data still might not be valid.
§Example
use c2pa::Reader;
let reader = Reader::from_file("path/to/file.jpg").unwrap();§Note
CAWG identity assertions require async calls for validation.
Sourcepub fn with_manifest_data_and_stream(
self,
c2pa_data: &[u8],
format: &str,
stream: impl Read + Seek + MaybeSend,
) -> Result<Self>
pub fn with_manifest_data_and_stream( self, c2pa_data: &[u8], format: &str, stream: impl Read + Seek + MaybeSend, ) -> Result<Self>
Add manifest store from existing c2pa_data and a stream to the Reader.
Use this to validate a remote manifest or a sidecar manifest.
§Arguments
c2pa_data- A C2PA manifest store in JUMBF format.format- The format of the stream.stream- The stream to verify the store against.
§Returns
The updated Reader with the added manifest store.
§Errors
This function returns an Error if the c2pa_data is not valid, or severe errors occur in validation.
You must check validation status for non-severe errors.
Sourcepub async fn with_manifest_data_and_stream_async(
self,
c2pa_data: &[u8],
format: &str,
stream: impl Read + Seek + MaybeSend,
) -> Result<Self>
pub async fn with_manifest_data_and_stream_async( self, c2pa_data: &[u8], format: &str, stream: impl Read + Seek + MaybeSend, ) -> Result<Self>
Add manifest store from existing c2pa_data and a stream to the Reader.
Use this to validate a remote manifest or a sidecar manifest.
§Arguments
c2pa_data- A C2PA manifest store in JUMBF format.format- The format of the stream.stream- The stream to verify the store against.
§Returns
The updated Reader with the added manifest store.
§Errors
This function returns an Error if the c2pa_data is not valid, or severe errors occur in validation.
You must check validation status for non-severe errors.
Sourcepub fn from_manifest_data_and_stream(
c2pa_data: &[u8],
format: &str,
stream: impl Read + Seek + MaybeSend,
) -> Result<Reader>
pub fn from_manifest_data_and_stream( c2pa_data: &[u8], format: &str, stream: impl Read + Seek + MaybeSend, ) -> Result<Reader>
Create a manifest store Reader from existing c2pa_data and a stream.
Use this to validate a remote manifest or a sidecar manifest.
§Arguments
c2pa_data- A C2PA manifest store in JUMBF format.format- The format of the stream.stream- The stream to verify the store against.
§Returns
A Reader for the manifest store.
§Errors
This function returns an Error ef the c2pa_data is not valid, or severe errors occur in validation.
You must check validation status for non-severe errors.
Sourcepub async fn from_manifest_data_and_stream_async(
c2pa_data: &[u8],
format: &str,
stream: impl Read + Seek + MaybeSend,
) -> Result<Reader>
pub async fn from_manifest_data_and_stream_async( c2pa_data: &[u8], format: &str, stream: impl Read + Seek + MaybeSend, ) -> Result<Reader>
Create a manifest store Reader from existing c2pa_data and a stream.
Use this to validate a remote manifest or a sidecar manifest.
§Arguments
c2pa_data- A C2PA manifest store in JUMBF format.format- The format of the stream.stream- The stream to verify the store against.
§Returns
A Reader for the manifest store.
§Errors
This function returns an Error ef the c2pa_data is not valid, or severe errors occur in validation.
You must check validation status for non-severe errors.
Sourcepub fn with_fragment(
self,
format: &str,
stream: impl Read + Seek + MaybeSend,
fragment: impl Read + Seek + MaybeSend,
) -> Result<Self>
pub fn with_fragment( self, format: &str, stream: impl Read + Seek + MaybeSend, fragment: impl Read + Seek + MaybeSend, ) -> Result<Self>
Add manifest store from an initial segment and a fragment stream to the Reader.
This would be used to load and validate fragmented MP4 files that span multiple separate asset files.
§Arguments
format- The format of the stream.stream- The initial segment stream.fragment- The fragment stream.
§Returns
The updated Reader with the added manifest store.
§Errors
This function returns an Error if the streams are not valid, or severe errors occur in validation.
You must check validation status for non-severe errors.
Sourcepub async fn with_fragment_async(
self,
format: &str,
stream: impl Read + Seek + MaybeSend,
fragment: impl Read + Seek + MaybeSend,
) -> Result<Self>
pub async fn with_fragment_async( self, format: &str, stream: impl Read + Seek + MaybeSend, fragment: impl Read + Seek + MaybeSend, ) -> Result<Self>
Add manifest store from an initial segment and a fragment stream to the Reader.
This would be used to load and validate fragmented MP4 files that span multiple separate asset files.
§Arguments
format- The format of the stream.stream- The initial segment stream.fragment- The fragment stream.
§Returns
The updated Reader with the added manifest store.
§Errors
This function returns an Error if the streams are not valid, or severe errors occur in validation.
You must check validation status for non-severe errors.
Sourcepub fn from_fragment(
format: &str,
stream: impl Read + Seek + MaybeSend,
fragment: impl Read + Seek + MaybeSend,
) -> Result<Self>
pub fn from_fragment( format: &str, stream: impl Read + Seek + MaybeSend, fragment: impl Read + Seek + MaybeSend, ) -> Result<Self>
Create a Reader from an initial segment and a fragment stream.
This would be used to load and validate fragmented MP4 files that span multiple separate asset files.
§Arguments
format- The format of the stream.stream- The initial segment stream.fragment- The fragment stream.
§Returns
A Reader for the manifest store.
§Errors
This function returns an Error if the streams are not valid, or severe errors occur in validation.
You must check validation status for non-severe errors.
Sourcepub async fn from_fragment_async(
format: &str,
stream: impl Read + Seek + MaybeSend,
fragment: impl Read + Seek + MaybeSend,
) -> Result<Self>
pub async fn from_fragment_async( format: &str, stream: impl Read + Seek + MaybeSend, fragment: impl Read + Seek + MaybeSend, ) -> Result<Self>
Create a Reader from an initial segment and a fragment stream.
This would be used to load and validate fragmented MP4 files that span multiple separate asset files.
§Arguments
format- The format of the stream.stream- The initial segment stream.fragment- The fragment stream.
§Returns
A Reader for the manifest store.
§Errors
This function returns an Error if the streams are not valid, or severe errors occur in validation.
You must check validation status for non-severe errors.
Sourcepub fn with_fragmented_files<P: AsRef<Path>>(
self,
path: P,
fragments: &Vec<PathBuf>,
) -> Result<Self>
Available on crate feature file_io only.
pub fn with_fragmented_files<P: AsRef<Path>>( self, path: P, fragments: &Vec<PathBuf>, ) -> Result<Self>
file_io only.Add manifest store from an initial segment and fragments to the Reader.
This would be used to load and validate fragmented MP4 files that span
multiple separate asset files.
§Arguments
path- The path to the initial segment file.fragments- A vector of paths to fragment files.
§Returns
The updated Reader with the added manifest store.
§Errors
Returns an Error when the manifest data cannot be read from the specified files.
Sourcepub fn from_fragmented_files<P: AsRef<Path>>(
path: P,
fragments: &Vec<PathBuf>,
) -> Result<Reader>
Available on crate feature file_io only.
pub fn from_fragmented_files<P: AsRef<Path>>( path: P, fragments: &Vec<PathBuf>, ) -> Result<Reader>
file_io only.Loads a Reader` from an initial segment and fragments. This
would be used to load and validate fragmented MP4 files that span
multiple separate asset files.
Sourcepub fn supported_mime_types() -> Vec<String>
pub fn supported_mime_types() -> Vec<String>
Returns a Vec of mime types that [c2pa-rs] is able to read.
Sourcepub fn json_checked(&self) -> Result<String>
pub fn json_checked(&self) -> Result<String>
Get the Reader as a JSON string, returning an error if formatting fails
This is useful when you need to handle errors from deeply nested or malformed structures.
For a version that never fails, use Self::json().
Sourcepub fn detailed_json(&self) -> String
pub fn detailed_json(&self) -> String
Get the Reader as a detailed JSON string This just calls to_json_detailed_formatted
Sourcepub fn detailed_json_checked(&self) -> Result<String>
pub fn detailed_json_checked(&self) -> Result<String>
Get the Reader as a detailed JSON string, returning an error if formatting fails
This is useful when you need to handle errors from deeply nested or malformed structures.
For a version that never fails, use Self::detailed_json().
Sourcepub fn remote_url(&self) -> Option<&str>
pub fn remote_url(&self) -> Option<&str>
Returns the remote url of the manifest if this Reader obtained the manifest remotely.
Sourcepub fn is_embedded(&self) -> bool
pub fn is_embedded(&self) -> bool
Returns if the Reader was created from an embedded manifest.
Sourcepub fn validation_status(&self) -> Option<&[ValidationStatus]>
pub fn validation_status(&self) -> Option<&[ValidationStatus]>
Get the [ValidationStatus] array of the manifest store if it exists.
Call this method to check for validation errors.
This validation report only includes error statuses applied to the active manifest
and error statuses for ingredients that are not already reported by the ingredient status.
Use the [ValidationStatus] url method to identify the associated manifest; this can be useful when a validation error does not refer to the active manifest.
§Example
use c2pa::Reader;
let stream = std::io::Cursor::new(include_bytes!("../tests/fixtures/CA.jpg"));
let reader = Reader::from_stream("image/jpeg", stream).unwrap();
let status = reader.validation_status();Sourcepub fn validation_results(&self) -> Option<&ValidationResults>
pub fn validation_results(&self) -> Option<&ValidationResults>
Get the ValidationResults map of an asset if it exists.
Call this method to check for detailed validation results. The validation_state method should be used to determine the overall validation state.
The results are divided between the active manifest and ingredient deltas. The deltas will only exist if there are validation errors not already reported in ingredients It is normal for there to be many success and information statuses. Any errors will be reported in the failure array.
§Example
use c2pa::Reader;
let stream = std::io::Cursor::new(include_bytes!("../tests/fixtures/CA.jpg"));
let reader = Reader::from_stream("image/jpeg", stream).unwrap();
let status = reader.validation_results();Sourcepub fn validation_state(&self) -> ValidationState
pub fn validation_state(&self) -> ValidationState
Get the ValidationState of the manifest store.
Sourcepub fn active_manifest(&self) -> Option<&Manifest>
pub fn active_manifest(&self) -> Option<&Manifest>
Return the active Manifest, or None if there’s no active manifest.
Sourcepub fn active_label(&self) -> Option<&str>
pub fn active_label(&self) -> Option<&str>
Return the active Manifest, or None if there’s no active manifest.
Sourcepub fn iter_manifests(&self) -> impl Iterator<Item = &Manifest> + '_
pub fn iter_manifests(&self) -> impl Iterator<Item = &Manifest> + '_
Returns an iterator over a collection of Manifest structs.
Sourcepub fn manifests(&self) -> &HashMap<String, Manifest>
pub fn manifests(&self) -> &HashMap<String, Manifest>
Returns a reference to the Manifest collection.
Sourcepub fn get_manifest(&self, label: &str) -> Option<&Manifest>
pub fn get_manifest(&self, label: &str) -> Option<&Manifest>
Sourcepub fn resource_to_stream(
&self,
uri: &str,
stream: impl Write + Read + Seek + MaybeSend,
) -> Result<usize>
pub fn resource_to_stream( &self, uri: &str, stream: impl Write + Read + Seek + MaybeSend, ) -> Result<usize>
Write a resource identified by URI to the given stream. Use this function, for example, to get a thumbnail or icon image and write it to a stream.
§Arguments
uri- The URI of the resource to write (from an identifier field).stream- The stream to write to.
§Returns
The number of bytes written.
§Errors
Returns Error if the resource does not exist.
§Example
use c2pa::Reader;
#[cfg(feature = "file_io")]
{
let stream = std::io::Cursor::new(Vec::new());
let reader = Reader::from_file("path/to/file.jpg").unwrap();
let manifest = reader.active_manifest().unwrap();
let uri = &manifest.thumbnail_ref().unwrap().identifier;
let bytes_written = reader.resource_to_stream(uri, stream).unwrap();
}TODO: Fix the example to not read from a file.
Sourcepub fn to_folder<P: AsRef<Path>>(&self, path: P) -> Result<()>
Available on crate feature file_io only.
pub fn to_folder<P: AsRef<Path>>(&self, path: P) -> Result<()>
file_io only.Write all resources to a folder.
This function writes all resources to a folder. Resources are stored in sub-folders corresponding to manifest label. Conversions ensure the file paths are valid.
§Arguments
path- The path to the folder to write to.
§Errors
Returns an Error if the resources cannot be written to the folder.
§Example
use c2pa::Reader;
let reader = Reader::from_file("path/to/file.jpg").unwrap();
reader.to_folder("path/to/folder").unwrap();Sourcepub fn post_validate(&mut self, validator: &impl PostValidator) -> Result<()>
pub fn post_validate(&mut self, validator: &impl PostValidator) -> Result<()>
Post-validate the reader. This function is called after the reader is created.
Sourcepub async fn post_validate_async(
&mut self,
validator: &impl AsyncPostValidator,
) -> Result<()>
pub async fn post_validate_async( &mut self, validator: &impl AsyncPostValidator, ) -> Result<()>
Post-validate the reader. This function is called after the reader is created.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Reader
impl<'de> Deserialize<'de> for Reader
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Reader
impl JsonSchema for Reader
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for Reader
impl !RefUnwindSafe for Reader
impl Send for Reader
impl Sync for Reader
impl Unpin for Reader
impl !UnwindSafe for Reader
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.