pub struct Manifest {
pub claim_generator: String,
pub claim_generator_info: Option<Vec<ClaimGeneratorInfo>>,
/* private fields */
}
Expand description
A Manifest represents all the information in a c2pa manifest
Fields§
§claim_generator: String
A User Agent formatted string identifying the software/hardware/system produced this claim Spaces are not allowed in names, versions can be specified with product/1.0 syntax
claim_generator_info: Option<Vec<ClaimGeneratorInfo>>
Implementations§
source§impl Manifest
impl Manifest
sourcepub fn new<S: Into<String>>(claim_generator: S) -> Self
pub fn new<S: Into<String>>(claim_generator: S) -> Self
Create a new Manifest requires a claim_generator string (User Agent))
sourcepub fn claim_generator(&self) -> &str
pub fn claim_generator(&self) -> &str
Returns a User Agent formatted string identifying the software/hardware/system produced this claim
sourcepub fn label(&self) -> Option<&str>
pub fn label(&self) -> Option<&str>
returns the manifest label for this Manifest, as referenced in a ManifestStore
sourcepub fn format(&self) -> &str
pub fn format(&self) -> &str
Returns a MIME content_type for the asset associated with this manifest.
sourcepub fn instance_id(&self) -> &str
pub fn instance_id(&self) -> &str
Returns the instance identifier.
sourcepub fn thumbnail(&self) -> Option<(&str, Cow<'_, Vec<u8>>)>
pub fn thumbnail(&self) -> Option<(&str, Cow<'_, Vec<u8>>)>
Returns thumbnail tuple with Some((format, bytes)) or None
sourcepub fn thumbnail_ref(&self) -> Option<&ResourceRef>
pub fn thumbnail_ref(&self) -> Option<&ResourceRef>
Returns a thumbnail ResourceRef or None
.
sourcepub fn ingredients(&self) -> &[Ingredient]
pub fn ingredients(&self) -> &[Ingredient]
Returns immutable Ingredients used by this Manifest This can include a parent as well as any placed assets
sourcepub fn ingredients_mut(&mut self) -> &mut [Ingredient]
pub fn ingredients_mut(&mut self) -> &mut [Ingredient]
Returns mutable Ingredients used by this Manifest This can include a parent as well as any placed assets
sourcepub fn assertions(&self) -> &[ManifestAssertion]
pub fn assertions(&self) -> &[ManifestAssertion]
Returns Assertions for this Manifest
sourcepub fn credentials(&self) -> Option<&[Value]>
pub fn credentials(&self) -> Option<&[Value]>
Returns Verifiable Credentials
sourcepub fn remote_manifest_url(&self) -> Option<&str>
pub fn remote_manifest_url(&self) -> Option<&str>
Returns the remote_manifest Url if there is one This is only used when creating a manifest, it will always be None when reading
sourcepub fn set_vendor<S: Into<String>>(&mut self, vendor: S) -> &mut Self
pub fn set_vendor<S: Into<String>>(&mut self, vendor: S) -> &mut Self
Sets the vendor prefix to be used when generating manifest labels
Optional prefix added to the generated Manifest Label
This is typically a lower case Internet domain name for the vendor (i.e. adobe
)
sourcepub fn set_label<S: Into<String>>(&mut self, label: S) -> &mut Self
pub fn set_label<S: Into<String>>(&mut self, label: S) -> &mut Self
Sets the label for this manifest A label will be generated if this is not called This is needed if embedding a URL that references the manifest label
sourcepub fn set_claim_generator<S: Into<String>>(
&mut self,
generator: S
) -> &mut Self
pub fn set_claim_generator<S: Into<String>>( &mut self, generator: S ) -> &mut Self
Sets a human readable name for the product that created this manifest
sourcepub fn set_format<S: Into<String>>(&mut self, format: S) -> &mut Self
pub fn set_format<S: Into<String>>(&mut self, format: S) -> &mut Self
Sets a human-readable title for this ingredient.
sourcepub fn set_instance_id<S: Into<String>>(&mut self, instance_id: S) -> &mut Self
pub fn set_instance_id<S: Into<String>>(&mut self, instance_id: S) -> &mut Self
Sets a human-readable title for this ingredient.
sourcepub fn set_title<S: Into<String>>(&mut self, title: S) -> &mut Self
pub fn set_title<S: Into<String>>(&mut self, title: S) -> &mut Self
Sets a human-readable title for this ingredient.
sourcepub fn set_thumbnail_ref(&mut self, thumbnail: ResourceRef) -> Result<&mut Self>
pub fn set_thumbnail_ref(&mut self, thumbnail: ResourceRef) -> Result<&mut Self>
Sets the thumbnail from a ResourceRef.
sourcepub fn set_thumbnail<S: Into<String>, B: Into<Vec<u8>>>(
&mut self,
format: S,
thumbnail: B
) -> Result<&mut Self>
pub fn set_thumbnail<S: Into<String>, B: Into<Vec<u8>>>( &mut self, format: S, thumbnail: B ) -> Result<&mut Self>
Sets the thumbnail format and image data.
sourcepub fn set_sidecar_manifest(&mut self) -> &mut Self
pub fn set_sidecar_manifest(&mut self) -> &mut Self
If set, the embed calls will create a sidecar .c2pa manifest file next to the output file No change will be made to the output file
sourcepub fn set_remote_manifest<S: Into<String>>(
&mut self,
remote_url: S
) -> &mut Self
pub fn set_remote_manifest<S: Into<String>>( &mut self, remote_url: S ) -> &mut Self
If set, the embed calls will put the remote url into the output file xmp provenance and create a c2pa manifest file next to the output file
sourcepub fn set_embedded_manifest_with_remote_ref<S: Into<String>>(
&mut self,
remote_url: S
) -> &mut Self
pub fn set_embedded_manifest_with_remote_ref<S: Into<String>>( &mut self, remote_url: S ) -> &mut Self
If set, the embed calls will put the remote url into the output file xmp provenance and will embed the manifest into the output file
pub fn signature_info(&self) -> Option<&SignatureInfo>
sourcepub fn parent(&self) -> Option<&Ingredient>
pub fn parent(&self) -> Option<&Ingredient>
Returns the parent ingredient if it exists
sourcepub fn set_parent(&mut self, ingredient: Ingredient) -> Result<&mut Self>
pub fn set_parent(&mut self, ingredient: Ingredient) -> Result<&mut Self>
Sets the parent ingredient, assuring it is first and setting the is_parent flag
sourcepub fn add_ingredient(&mut self, ingredient: Ingredient) -> &mut Self
pub fn add_ingredient(&mut self, ingredient: Ingredient) -> &mut Self
Add an ingredient removing duplicates (consumes the asset)
sourcepub fn add_labeled_assertion<S: Into<String>, T: Serialize>(
&mut self,
label: S,
data: &T
) -> Result<&mut Self>
pub fn add_labeled_assertion<S: Into<String>, T: Serialize>( &mut self, label: S, data: &T ) -> Result<&mut Self>
Adds assertion using given label and any serde serializable The data for predefined assertions must be in correct format
§Example: Creating a custom assertion from a serde_json object.
use c2pa::Manifest;
use serde_json::json;
let mut manifest = Manifest::new("my_app");
let value = json!({"my_tag": "Anything I want"});
manifest.add_labeled_assertion("org.contentauth.foo", &value)?;
sourcepub fn add_assertion<T: Serialize + AssertionBase>(
&mut self,
data: &T
) -> Result<&mut Self>
pub fn add_assertion<T: Serialize + AssertionBase>( &mut self, data: &T ) -> Result<&mut Self>
Adds ManifestAssertions from existing assertions The data for standard assertions must be in correct format
§Example: Creating a from an Actions object.
use c2pa::{
assertions::{c2pa_action, Action, Actions},
Manifest,
};
let mut manifest = Manifest::new("my_app");
let actions = Actions::new().add_action(Action::new(c2pa_action::EDITED));
manifest.add_assertion(&actions)?;
sourcepub fn find_assertion<T: DeserializeOwned>(&self, label: &str) -> Result<T>
pub fn find_assertion<T: DeserializeOwned>(&self, label: &str) -> Result<T>
Retrieves an assertion by label if it exists or Error::NotFound
Example: Find an Actions Assertion
use c2pa::{
assertions::{c2pa_action, Action, Actions},
Manifest,
};
let mut manifest = Manifest::new("my_app");
let actions = Actions::new().add_action(Action::new(c2pa_action::EDITED));
manifest.add_assertion(&actions)?;
let actions: Actions = manifest.find_assertion(Actions::LABEL)?;
for action in actions.actions {
println!("{}", action.action());
}
sourcepub fn find_assertion_with_instance<T: DeserializeOwned>(
&self,
label: &str,
instance: usize
) -> Result<T>
pub fn find_assertion_with_instance<T: DeserializeOwned>( &self, label: &str, instance: usize ) -> Result<T>
Retrieves an assertion by label and instance if it exists or Error::NotFound
sourcepub fn add_redaction<S: Into<String>>(&mut self, label: S) -> Result<&mut Self>
pub fn add_redaction<S: Into<String>>(&mut self, label: S) -> Result<&mut Self>
Redacts an assertion from the parent Ingredient of this manifest using the provided assertion label.
sourcepub fn add_verifiable_credential<T: Serialize>(
&mut self,
data: &T
) -> Result<&mut Self>
pub fn add_verifiable_credential<T: Serialize>( &mut self, data: &T ) -> Result<&mut Self>
Add verifiable credentials
sourcepub fn resources(&self) -> &ResourceStore
pub fn resources(&self) -> &ResourceStore
Return an immutable reference to the manifest resources
sourcepub fn resources_mut(&mut self) -> &mut ResourceStore
pub fn resources_mut(&mut self) -> &mut ResourceStore
Return a mutable reference to the manifest resources
sourcepub fn from_json(json: &str) -> Result<Self>
pub fn from_json(json: &str) -> Result<Self>
Creates a Manifest from a JSON string formatted as a Manifest
sourcepub fn with_base_path<P: AsRef<Path>>(&mut self, base_path: P) -> Result<&Self>
Available on crate feature file_io
only.
pub fn with_base_path<P: AsRef<Path>>(&mut self, base_path: P) -> Result<&Self>
file_io
only.Setting a base path will make the manifest use resource files instead of memory buffers
The files will be relative to the given base path Ingredients resources will also be relative to this path
sourcepub fn set_asset_from_path<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
Available on crate feature file_io
only.
pub fn set_asset_from_path<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
file_io
only.Sets the asset field from data in a file the information in the claim should reflect the state of the asset it is embedded in this method can be used to ensure that data is correct it will extract filename,format and xmp info and generate a thumbnail
sourcepub fn embed<P: AsRef<Path>>(
&mut self,
source_path: P,
dest_path: P,
signer: &dyn Signer
) -> Result<Vec<u8>>
Available on crate feature file_io
only.
pub fn embed<P: AsRef<Path>>( &mut self, source_path: P, dest_path: P, signer: &dyn Signer ) -> Result<Vec<u8>>
file_io
only.Embed a signed manifest into the target file using a supplied signer.
§Example: Embed a manifest in a file
use c2pa::{create_signer, Manifest, SigningAlg};
use serde::Serialize;
#[derive(Serialize)]
struct Test {
my_tag: usize,
}
let mut manifest = Manifest::new("my_app".to_owned());
manifest.add_labeled_assertion("org.contentauth.test", &Test { my_tag: 42 })?;
// Create a PS256 signer using certs and public key files.
let signcert_path = "tests/fixtures/certs/ps256.pub";
let pkey_path = "tests/fixtures/certs/ps256.pem";
let signer = create_signer::from_files(signcert_path, pkey_path, SigningAlg::Ps256, None)?;
// Embed a manifest using the signer.
manifest.embed("tests/fixtures/C.jpg", "../target/test_file.jpg", &*signer)?;
sourcepub fn embed_from_memory(
&mut self,
format: &str,
asset: &[u8],
signer: &dyn Signer
) -> Result<Vec<u8>>
pub fn embed_from_memory( &mut self, format: &str, asset: &[u8], signer: &dyn Signer ) -> Result<Vec<u8>>
Embed a signed manifest into a stream using a supplied signer. returns the bytes of the manifest that was embedded
sourcepub fn embed_stream(
&mut self,
format: &str,
stream: &mut dyn CAIRead,
signer: &dyn Signer
) -> Result<Vec<u8>>
👎Deprecated since 0.27.2: use embed_to_stream instead
pub fn embed_stream( &mut self, format: &str, stream: &mut dyn CAIRead, signer: &dyn Signer ) -> Result<Vec<u8>>
Embed a signed manifest into a stream using a supplied signer.
Returns the bytes of the new asset
sourcepub fn embed_to_stream(
&mut self,
format: &str,
source: &mut dyn CAIRead,
dest: &mut dyn CAIReadWrite,
signer: &dyn Signer
) -> Result<Vec<u8>>
pub fn embed_to_stream( &mut self, format: &str, source: &mut dyn CAIRead, dest: &mut dyn CAIReadWrite, signer: &dyn Signer ) -> Result<Vec<u8>>
Embed a signed manifest into a stream using a supplied signer.
Returns the bytes of c2pa_manifest that was embedded.
sourcepub async fn embed_from_memory_remote_signed(
&mut self,
format: &str,
asset: &[u8],
signer: &dyn RemoteSigner
) -> Result<(Vec<u8>, Vec<u8>)>
pub async fn embed_from_memory_remote_signed( &mut self, format: &str, asset: &[u8], signer: &dyn RemoteSigner ) -> Result<(Vec<u8>, Vec<u8>)>
Embed a signed manifest into a stream using a supplied signer. returns the asset generated and bytes of the manifest that was embedded
sourcepub async fn embed_async_signed<P: AsRef<Path>>(
&mut self,
source_path: P,
dest_path: P,
signer: &dyn AsyncSigner
) -> Result<Vec<u8>>
Available on crate feature file_io
only.
pub async fn embed_async_signed<P: AsRef<Path>>( &mut self, source_path: P, dest_path: P, signer: &dyn AsyncSigner ) -> Result<Vec<u8>>
file_io
only.Embed a signed manifest into the target file using a supplied AsyncSigner
.
sourcepub async fn embed_remote_signed<P: AsRef<Path>>(
&mut self,
source_path: P,
dest_path: P,
signer: &dyn RemoteSigner
) -> Result<Vec<u8>>
Available on crate feature file_io
only.
pub async fn embed_remote_signed<P: AsRef<Path>>( &mut self, source_path: P, dest_path: P, signer: &dyn RemoteSigner ) -> Result<Vec<u8>>
file_io
only.Embed a signed manifest into the target file using a supplied RemoteSigner
.
sourcepub fn remove_manifest<P: AsRef<Path>>(asset_path: P) -> Result<()>
Available on crate feature file_io
only.
pub fn remove_manifest<P: AsRef<Path>>(asset_path: P) -> Result<()>
file_io
only.Removes any existing manifest from a file
This should only be used for special cases, such as converting an embedded manifest to a cloud manifest
sourcepub fn data_hash_placeholder(
&mut self,
reserve_size: usize,
format: &str
) -> Result<Vec<u8>>
pub fn data_hash_placeholder( &mut self, reserve_size: usize, format: &str ) -> Result<Vec<u8>>
Generates a data hashed placeholder manifest for a file
The return value is pre-formatted for insertion into a file of the given format For JPEG it is a series of App11 JPEG segments containing space for a manifest This is used to create a properly formatted file ready for signing. The reserve_size is the amount of space to reserve for the signature box. This value is fixed once set and must be sufficient to hold the completed signature
sourcepub fn data_hash_embeddable_manifest(
&mut self,
dh: &DataHash,
signer: &dyn Signer,
format: &str,
asset_reader: Option<&mut dyn CAIRead>
) -> Result<Vec<u8>>
pub fn data_hash_embeddable_manifest( &mut self, dh: &DataHash, signer: &dyn Signer, format: &str, asset_reader: Option<&mut dyn CAIRead> ) -> Result<Vec<u8>>
Generates an data hashed embeddable manifest for a file
The return value is pre-formatted for insertion into a file of the given format For JPEG it is a series of App11 JPEG segments containing a signed manifest This can directly replace a placeholder manifest to create a properly signed asset The data hash must contain exclusions and may contain pre-calculated hashes if an asset reader is provided, it will be used to calculate the data hash
sourcepub async fn data_hash_embeddable_manifest_remote(
&mut self,
dh: &DataHash,
signer: &dyn RemoteSigner,
format: &str,
asset_reader: Option<&mut dyn CAIRead>
) -> Result<Vec<u8>>
pub async fn data_hash_embeddable_manifest_remote( &mut self, dh: &DataHash, signer: &dyn RemoteSigner, format: &str, asset_reader: Option<&mut dyn CAIRead> ) -> Result<Vec<u8>>
Generates an data hashed embeddable manifest for a file
The return value is pre-formatted for insertion into a file of the given format For JPEG it is a series of App11 JPEG segments containing a signed manifest This can directly replace a placeholder manifest to create a properly signed asset The data hash must contain exclusions and may contain pre-calculated hashes if an asset reader is provided, it will be used to calculate the data hash
Trait Implementations§
source§impl<'de> Deserialize<'de> for Manifest
impl<'de> Deserialize<'de> for Manifest
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 Manifest
impl JsonSchema for Manifest
source§fn schema_name() -> String
fn schema_name() -> String
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moreAuto Trait Implementations§
impl Freeze for Manifest
impl RefUnwindSafe for Manifest
impl Send for Manifest
impl Sync for Manifest
impl Unpin for Manifest
impl UnwindSafe for Manifest
Blanket Implementations§
source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
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, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
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, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
source§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> 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.