Struct c2pa::Manifest

source ·
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

source

pub fn new<S: Into<String>>(claim_generator: S) -> Self

Create a new Manifest requires a claim_generator string (User Agent))

source

pub fn claim_generator(&self) -> &str

Returns a User Agent formatted string identifying the software/hardware/system produced this claim

source

pub fn label(&self) -> Option<&str>

returns the manifest label for this Manifest, as referenced in a ManifestStore

source

pub fn format(&self) -> &str

Returns a MIME content_type for the asset associated with this manifest.

source

pub fn instance_id(&self) -> &str

Returns the instance identifier.

source

pub fn title(&self) -> Option<&str>

Returns a user-displayable title for this manifest

source

pub fn thumbnail(&self) -> Option<(&str, Cow<'_, Vec<u8>>)>

Returns thumbnail tuple with Some((format, bytes)) or None

source

pub fn thumbnail_ref(&self) -> Option<&ResourceRef>

Returns a thumbnail ResourceRef or None.

source

pub fn ingredients(&self) -> &[Ingredient]

Returns immutable Ingredients used by this Manifest This can include a parent as well as any placed assets

source

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

source

pub fn assertions(&self) -> &[ManifestAssertion]

Returns Assertions for this Manifest

source

pub fn credentials(&self) -> Option<&[Value]>

Returns Verifiable Credentials

source

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

source

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)

source

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

source

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

source

pub fn set_format<S: Into<String>>(&mut self, format: S) -> &mut Self

Sets a human-readable title for this ingredient.

source

pub fn set_instance_id<S: Into<String>>(&mut self, instance_id: S) -> &mut Self

Sets a human-readable title for this ingredient.

source

pub fn set_title<S: Into<String>>(&mut self, title: S) -> &mut Self

Sets a human-readable title for this ingredient.

source

pub fn set_thumbnail_ref(&mut self, thumbnail: ResourceRef) -> Result<&mut Self>

Sets the thumbnail from a ResourceRef.

source

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.

source

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

source

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

source

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

source

pub fn signature_info(&self) -> Option<&SignatureInfo>

source

pub fn parent(&self) -> Option<&Ingredient>

Returns the parent ingredient if it exists

source

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

source

pub fn add_ingredient(&mut self, ingredient: Ingredient) -> &mut Self

Add an ingredient removing duplicates (consumes the asset)

source

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)?;
source

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)?;
source

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());
}
source

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

source

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.

source

pub fn add_verifiable_credential<T: Serialize>( &mut self, data: &T ) -> Result<&mut Self>

Add verifiable credentials

source

pub fn issuer(&self) -> Option<String>

Returns the name of the signature issuer

source

pub fn time(&self) -> Option<String>

Returns the time that the manifest was signed

source

pub fn resources(&self) -> &ResourceStore

Return an immutable reference to the manifest resources

source

pub fn resources_mut(&mut self) -> &mut ResourceStore

Return a mutable reference to the manifest resources

source

pub fn from_json(json: &str) -> Result<Self>

Creates a Manifest from a JSON string formatted as a Manifest

source

pub fn with_base_path<P: AsRef<Path>>(&mut self, base_path: P) -> Result<&Self>

Available on crate feature 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

source

pub fn set_asset_from_path<P: AsRef<Path>>(&mut self, path: P) -> Result<()>

Available on crate feature 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

source

pub 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.

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)?;
source

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

source

pub 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

Embed a signed manifest into a stream using a supplied signer.

Returns the bytes of the new asset

source

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.

source

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

source

pub 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.

Embed a signed manifest into the target file using a supplied AsyncSigner.

source

pub 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.

Embed a signed manifest into the target file using a supplied RemoteSigner.

source

pub fn remove_manifest<P: AsRef<Path>>(asset_path: P) -> Result<()>

Available on crate feature 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

source

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

source

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

source

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

source

pub fn box_hash_embeddable_manifest( &mut self, signer: &dyn Signer, format: Option<&str> ) -> Result<Vec<u8>>

Generates a signed box hashed manifest, optionally preformatted for embedding

The manifest must include a box hash assertion with correct hashes

source

pub fn composed_manifest(manifest_bytes: &[u8], format: &str) -> Result<Vec<u8>>

Formats a signed manifest for embedding in the given format

For instance, this would return one or JPEG App11 segments containing the manifest

Trait Implementations§

source§

impl Debug for Manifest

source§

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

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

impl Default for Manifest

source§

fn default() -> Manifest

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for Manifest

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for Manifest

source§

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

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

impl JsonSchema for Manifest

source§

fn schema_name() -> String

The name of the generated JSON Schema. Read more
source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
source§

fn json_schema(gen: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
source§

fn is_referenceable() -> bool

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more
source§

impl Serialize for Manifest

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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<Src, Scheme> ApproxFrom<Src, Scheme> for Src
where Scheme: ApproxScheme,

§

type Err = NoError

The error type produced by a failed conversion.
source§

fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>

Convert the given value into an approximately equivalent representation.
source§

impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src
where Dst: ApproxFrom<Src, Scheme>, Scheme: ApproxScheme,

§

type Err = <Dst as ApproxFrom<Src, Scheme>>::Err

The error type produced by a failed conversion.
source§

fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>

Convert the subject into an approximately equivalent representation.
source§

impl<T> AsHexdump for T

source§

fn as_hexdump(&self) -> Hexdump<'_>

source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

source§

fn implicit( self, class: Class, constructed: bool, tag: u32 ) -> TaggedParser<'a, Implicit, Self, E>

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

source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
source§

impl<T, Dst> ConvAsUtil<Dst> for T

source§

fn approx(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst>,

Approximate the subject with the default scheme.
source§

fn approx_by<Scheme>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,

Approximate the subject with a specific scheme.
source§

impl<T> ConvUtil for T

source§

fn approx_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst>,

Approximate the subject to a given type with the default scheme.
source§

fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,

Approximate the subject to a given type with a specific scheme.
source§

fn into_as<Dst>(self) -> Dst
where Self: Sized + Into<Dst>,

Convert the subject to a given type.
source§

fn try_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + TryInto<Dst>,

Attempt to convert the subject to a given type.
source§

fn value_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + ValueInto<Dst>,

Attempt a value conversion of the subject to a given type.
source§

impl<T> FmtForward for T

source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

source§

const WITNESS: W = W::MAKE

A constant of the type witness
source§

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

§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
source§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
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> Pipe for T
where T: ?Sized,

source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows 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
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows 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
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

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

§

type Output = T

Should always be Self
source§

impl<T> Tap for T

source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .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
where Self: BorrowMut<B>, B: ?Sized,

Calls .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
where Self: AsRef<R>, R: ?Sized,

Calls .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
where Self: AsMut<R>, R: ?Sized,

Calls .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
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T> TryConv for T

source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
source§

impl<Src> TryFrom<Src> for Src

§

type Err = NoError

The error type produced by a failed conversion.
source§

fn try_from(src: Src) -> Result<Src, <Src as TryFrom<Src>>::Err>

Convert the given value into the subject type.
source§

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

§

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<Src, Dst> TryInto<Dst> for Src
where Dst: TryFrom<Src>,

§

type Err = <Dst as TryFrom<Src>>::Err

The error type produced by a failed conversion.
source§

fn try_into(self) -> Result<Dst, <Src as TryInto<Dst>>::Err>

Convert the subject into the destination type.
source§

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

§

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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<Src> ValueFrom<Src> for Src

§

type Err = NoError

The error type produced by a failed conversion.
source§

fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>

Convert the given value into an exactly equivalent representation.
source§

impl<Src, Dst> ValueInto<Dst> for Src
where Dst: ValueFrom<Src>,

§

type Err = <Dst as ValueFrom<Src>>::Err

The error type produced by a failed conversion.
source§

fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>

Convert the subject into an exactly equivalent representation.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,