Enum sequoia_openpgp::Packet

source ·
#[non_exhaustive]
pub enum Packet {
Show 18 variants Unknown(Unknown), Signature(Signature), OnePassSig(OnePassSig), PublicKey(Key<PublicParts, PrimaryRole>), PublicSubkey(Key<PublicParts, SubordinateRole>), SecretKey(Key<SecretParts, PrimaryRole>), SecretSubkey(Key<SecretParts, SubordinateRole>), Marker(Marker), Trust(Trust), UserID(UserID), UserAttribute(UserAttribute), Literal(Literal), CompressedData(CompressedData), PKESK(PKESK), SKESK(SKESK), SEIP(SEIP), MDC(MDC), AED(AED),
}
Expand description

Enumeration of packet types.

The different OpenPGP packets are detailed in Section 5 of RFC 4880.

The Unknown packet allows Sequoia to deal with packets that it doesn’t understand. It is basically a binary blob that includes the packet’s tag. See the module-level documentation for details.

Note: This enum cannot be exhaustively matched to allow future extensions.

§A note on equality

We define equality on Packet as the equality of the serialized form of their packet bodies as defined by RFC 4880. That is, two packets are considered equal if and only if their serialized forms are equal, modulo the OpenPGP framing (CTB and length style, potential partial body encoding).

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Unknown(Unknown)

Unknown packet.

§

Signature(Signature)

Signature packet.

§

OnePassSig(OnePassSig)

One pass signature packet.

§

PublicKey(Key<PublicParts, PrimaryRole>)

Public key packet.

§

PublicSubkey(Key<PublicParts, SubordinateRole>)

Public subkey packet.

§

SecretKey(Key<SecretParts, PrimaryRole>)

Public/Secret key pair.

§

SecretSubkey(Key<SecretParts, SubordinateRole>)

Public/Secret subkey pair.

§

Marker(Marker)

Marker packet.

§

Trust(Trust)

Trust packet.

§

UserID(UserID)

User ID packet.

§

UserAttribute(UserAttribute)

User attribute packet.

§

Literal(Literal)

Literal data packet.

§

CompressedData(CompressedData)

Compressed literal data packet.

§

PKESK(PKESK)

Public key encrypted data packet.

§

SKESK(SKESK)

Symmetric key encrypted data packet.

§

SEIP(SEIP)

Symmetric key encrypted, integrity protected data packet.

§

MDC(MDC)

👎Deprecated

Modification detection code packet.

§

AED(AED)

AEAD Encrypted Data Packet.

Implementations§

source§

impl Packet

source

pub fn tag(&self) -> Tag

Returns the Packet's corresponding OpenPGP tag.

Tags are explained in Section 4.3 of RFC 4880.

source

pub fn kind(&self) -> Option<Tag>

Returns the parsed Packet's corresponding OpenPGP tag.

Returns the packets tag, but only if it was successfully parsed into the corresponding packet type. If e.g. a Signature Packet uses some unsupported methods, it is parsed into an Packet::Unknown. tag() returns Tag::Signature, whereas kind() returns None.

source

pub fn version(&self) -> Option<u8>

Returns the Packet's version, if the packet is versioned and recognized.

If the packet is not versioned, or we couldn’t parse the packet, this function returns None.

source

pub fn normalized_hash<H>(&self, state: &mut H)
where H: Hasher,

Hashes most everything into state.

This is an alternate implementation of Hash, which does not hash:

  • The unhashed subpacket area of Signature packets.
  • Secret key material.

Unlike Signature::normalize, this method ignores authenticated packets in the unhashed subpacket area.

Trait Implementations§

source§

impl Any<AED> for Packet

source§

fn downcast(self) -> Result<AED, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&AED>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut(&mut self) -> Option<&mut AED>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl Any<CompressedData> for Packet

source§

fn downcast(self) -> Result<CompressedData, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&CompressedData>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut(&mut self) -> Option<&mut CompressedData>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl Any<Key<PublicParts, PrimaryRole>> for Packet

source§

fn downcast(self) -> Result<Key<PublicParts, PrimaryRole>, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&Key<PublicParts, PrimaryRole>>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut(&mut self) -> Option<&mut Key<PublicParts, PrimaryRole>>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl Any<Key<PublicParts, SubordinateRole>> for Packet

source§

fn downcast(self) -> Result<Key<PublicParts, SubordinateRole>, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&Key<PublicParts, SubordinateRole>>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut(&mut self) -> Option<&mut Key<PublicParts, SubordinateRole>>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl Any<Key<PublicParts, UnspecifiedRole>> for Packet

source§

fn downcast(self) -> Result<Key<PublicParts, UnspecifiedRole>, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&Key<PublicParts, UnspecifiedRole>>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut(&mut self) -> Option<&mut Key<PublicParts, UnspecifiedRole>>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl Any<Key<SecretParts, PrimaryRole>> for Packet

source§

fn downcast(self) -> Result<Key<SecretParts, PrimaryRole>, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&Key<SecretParts, PrimaryRole>>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut(&mut self) -> Option<&mut Key<SecretParts, PrimaryRole>>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl Any<Key<SecretParts, SubordinateRole>> for Packet

source§

fn downcast(self) -> Result<Key<SecretParts, SubordinateRole>, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&Key<SecretParts, SubordinateRole>>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut(&mut self) -> Option<&mut Key<SecretParts, SubordinateRole>>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl Any<Key<SecretParts, UnspecifiedRole>> for Packet

source§

fn downcast(self) -> Result<Key<SecretParts, UnspecifiedRole>, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&Key<SecretParts, UnspecifiedRole>>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut(&mut self) -> Option<&mut Key<SecretParts, UnspecifiedRole>>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl Any<Key<UnspecifiedParts, PrimaryRole>> for Packet

source§

fn downcast(self) -> Result<Key<UnspecifiedParts, PrimaryRole>, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&Key<UnspecifiedParts, PrimaryRole>>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut(&mut self) -> Option<&mut Key<UnspecifiedParts, PrimaryRole>>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl Any<Key<UnspecifiedParts, SubordinateRole>> for Packet

source§

fn downcast(self) -> Result<Key<UnspecifiedParts, SubordinateRole>, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&Key<UnspecifiedParts, SubordinateRole>>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut( &mut self ) -> Option<&mut Key<UnspecifiedParts, SubordinateRole>>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl Any<Key<UnspecifiedParts, UnspecifiedRole>> for Packet

source§

fn downcast(self) -> Result<Key<UnspecifiedParts, UnspecifiedRole>, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&Key<UnspecifiedParts, UnspecifiedRole>>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut( &mut self ) -> Option<&mut Key<UnspecifiedParts, UnspecifiedRole>>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl Any<Literal> for Packet

source§

fn downcast(self) -> Result<Literal, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&Literal>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut(&mut self) -> Option<&mut Literal>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl Any<MDC> for Packet

source§

fn downcast(self) -> Result<MDC, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&MDC>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut(&mut self) -> Option<&mut MDC>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl Any<Marker> for Packet

source§

fn downcast(self) -> Result<Marker, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&Marker>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut(&mut self) -> Option<&mut Marker>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl Any<OnePassSig> for Packet

source§

fn downcast(self) -> Result<OnePassSig, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&OnePassSig>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut(&mut self) -> Option<&mut OnePassSig>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl Any<PKESK> for Packet

source§

fn downcast(self) -> Result<PKESK, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&PKESK>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut(&mut self) -> Option<&mut PKESK>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl Any<SEIP> for Packet

source§

fn downcast(self) -> Result<SEIP, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&SEIP>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut(&mut self) -> Option<&mut SEIP>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl Any<SKESK> for Packet

source§

fn downcast(self) -> Result<SKESK, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&SKESK>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut(&mut self) -> Option<&mut SKESK>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl Any<Signature> for Packet

source§

fn downcast(self) -> Result<Signature, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&Signature>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut(&mut self) -> Option<&mut Signature>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl Any<Trust> for Packet

source§

fn downcast(self) -> Result<Trust, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&Trust>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut(&mut self) -> Option<&mut Trust>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl Any<Unknown> for Packet

source§

fn downcast(self) -> Result<Unknown, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&Unknown>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut(&mut self) -> Option<&mut Unknown>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl Any<UserAttribute> for Packet

source§

fn downcast(self) -> Result<UserAttribute, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&UserAttribute>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut(&mut self) -> Option<&mut UserAttribute>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl Any<UserID> for Packet

source§

fn downcast(self) -> Result<UserID, Packet>

Attempts to downcast to T, returning the packet if it fails. Read more
source§

fn downcast_ref(&self) -> Option<&UserID>

Attempts to downcast to &T, returning None if it fails. Read more
source§

fn downcast_mut(&mut self) -> Option<&mut UserID>

Attempts to downcast to &mut T, returning None if it fails. Read more
source§

impl Clone for Packet

source§

fn clone(&self) -> Packet

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Packet

source§

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

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

impl DerefMut for Packet

source§

fn deref_mut(&mut self) -> &mut Common

Mutably dereferences the value.
source§

impl From<&Packet> for Tag

source§

fn from(p: &Packet) -> Tag

Converts to this type from the input type.
source§

impl From<AED> for Packet

source§

fn from(p: AED) -> Self

Converts to this type from the input type.
source§

impl From<AED1> for Packet

source§

fn from(p: AED1) -> Self

Converts to this type from the input type.
source§

impl From<CompressedData> for Packet

source§

fn from(s: CompressedData) -> Self

Converts to this type from the input type.
source§

impl From<Key<PublicParts, PrimaryRole>> for Packet

source§

fn from(k: Key<PublicParts, PrimaryRole>) -> Self

Convert the Key struct to a Packet.

source§

impl From<Key<PublicParts, SubordinateRole>> for Packet

source§

fn from(k: Key<PublicParts, SubordinateRole>) -> Self

Convert the Key struct to a Packet.

source§

impl From<Key<SecretParts, PrimaryRole>> for Packet

source§

fn from(k: Key<SecretParts, PrimaryRole>) -> Self

Convert the Key struct to a Packet.

source§

impl From<Key<SecretParts, SubordinateRole>> for Packet

source§

fn from(k: Key<SecretParts, SubordinateRole>) -> Self

Convert the Key struct to a Packet.

source§

impl From<Literal> for Packet

source§

fn from(s: Literal) -> Self

Converts to this type from the input type.
source§

impl From<MDC> for Packet

source§

fn from(s: MDC) -> Self

Converts to this type from the input type.
source§

impl From<Marker> for Packet

source§

fn from(p: Marker) -> Self

Converts to this type from the input type.
source§

impl From<OnePassSig> for Packet

source§

fn from(s: OnePassSig) -> Self

Converts to this type from the input type.
source§

impl From<OnePassSig3> for Packet

source§

fn from(p: OnePassSig3) -> Self

Converts to this type from the input type.
source§

impl From<PKESK> for Packet

source§

fn from(p: PKESK) -> Self

Converts to this type from the input type.
source§

impl From<PKESK3> for Packet

source§

fn from(p: PKESK3) -> Self

Converts to this type from the input type.
source§

impl From<Packet> for PacketPile

source§

fn from(p: Packet) -> Self

Converts to this type from the input type.
source§

impl From<Packet> for Result<Packet>

source§

fn from(p: Packet) -> Self

Converts to this type from the input type.
source§

impl From<Packet> for Tag

source§

fn from(p: Packet) -> Tag

Converts to this type from the input type.
source§

impl From<SEIP> for Packet

source§

fn from(p: SEIP) -> Self

Converts to this type from the input type.
source§

impl From<SEIP1> for Packet

source§

fn from(s: SEIP1) -> Self

Converts to this type from the input type.
source§

impl From<SKESK> for Packet

source§

fn from(p: SKESK) -> Self

Converts to this type from the input type.
source§

impl From<SKESK4> for Packet

source§

fn from(s: SKESK4) -> Self

Converts to this type from the input type.
source§

impl From<SKESK5> for Packet

source§

fn from(s: SKESK5) -> Self

Converts to this type from the input type.
source§

impl From<Signature> for Packet

source§

fn from(s: Signature) -> Self

Converts to this type from the input type.
source§

impl From<Signature3> for Packet

source§

fn from(s: Signature3) -> Self

Converts to this type from the input type.
source§

impl From<Signature4> for Packet

source§

fn from(s: Signature4) -> Self

Converts to this type from the input type.
source§

impl From<Trust> for Packet

source§

fn from(s: Trust) -> Self

Converts to this type from the input type.
source§

impl From<Unknown> for Packet

source§

fn from(s: Unknown) -> Self

Converts to this type from the input type.
source§

impl From<UserAttribute> for Packet

source§

fn from(s: UserAttribute) -> Self

Converts to this type from the input type.
source§

impl From<UserID> for Packet

source§

fn from(s: UserID) -> Self

Converts to this type from the input type.
source§

impl FromIterator<Packet> for PacketPile

source§

fn from_iter<I: IntoIterator<Item = Packet>>(iter: I) -> Self

Creates a value from an iterator. Read more
source§

impl Hash for Packet

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl IntoIterator for Packet

Implement IntoIterator so that cert::insert_packets(sig) just works.

§

type Item = Packet

The type of the elements being iterated over.
§

type IntoIter = Once<Packet>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl Marshal for Packet

source§

fn serialize(&self, o: &mut dyn Write) -> Result<()>

Writes a serialized version of the specified Packet to o.

This function works recursively: if the packet contains any packets, they are also serialized.

source§

fn export(&self, o: &mut dyn Write) -> Result<()>

Exports a serialized version of the specified Packet to o.

This function works recursively: if the packet contains any packets, they are also serialized.

source§

impl MarshalInto for Packet

source§

fn serialized_len(&self) -> usize

Computes the maximal length of the serialized representation. Read more
source§

fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>

Serializes into the given buffer. Read more
source§

fn export_into(&self, buf: &mut [u8]) -> Result<usize>

Exports into the given buffer. Read more
source§

fn to_vec(&self) -> Result<Vec<u8>>

Serializes the packet to a vector.
source§

fn export_to_vec(&self) -> Result<Vec<u8>>

Exports to a vector. Read more
source§

impl<'a> Parse<'a, Packet> for Packet

source§

fn from_buffered_reader<R>(reader: R) -> Result<Self>
where R: BufferedReader<Cookie> + 'a,

Reads from the given buffered reader.
source§

fn from_reader<R: 'a + Read + Send + Sync>(reader: R) -> Result<Self>

Reads from the given reader.
source§

fn from_bytes<D: AsRef<[u8]> + ?Sized + Send + Sync>( data: &'a D ) -> Result<Self>

Reads from the given slice. Read more
source§

fn from_file<P: AsRef<Path>>(path: P) -> Result<T>

Reads from the given file. Read more
source§

impl PartialEq for Packet

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Packet

source§

fn serialize(&self, o: &mut dyn Write) -> Result<()>

Writes a serialized version of the object to o.
source§

fn export(&self, o: &mut dyn Write) -> Result<()>

Exports a serialized version of the object to o. Read more
source§

impl SerializeInto for Packet

source§

fn serialized_len(&self) -> usize

Computes the maximal length of the serialized representation. Read more
source§

fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>

Serializes into the given buffer. Read more
source§

fn to_vec(&self) -> Result<Vec<u8>>

Serializes the packet to a vector.
source§

fn export_into(&self, buf: &mut [u8]) -> Result<usize>

Exports into the given buffer. Read more
source§

fn export_to_vec(&self) -> Result<Vec<u8>>

Exports to a vector. Read more
source§

impl TryFrom<Packet> for Cert

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: Packet) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<Packet> for Unknown

source§

fn try_from(p: Packet) -> Result<Self, Self::Error>

Tries to convert a packet to an Unknown. Returns an error if the given packet is a container packet (i.e. a compressed data packet or an encrypted data packet of any kind).

§

type Error = Error

The type returned in the event of a conversion error.
source§

impl<'a> TryFrom<RawPacket<'a>> for Packet

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(p: RawPacket<'a>) -> Result<Self>

Performs the conversion.
source§

impl Deref for Packet

§

type Target = Common

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Eq for Packet

source§

impl StructuralPartialEq for Packet

Auto Trait Implementations§

§

impl !Freeze for Packet

§

impl RefUnwindSafe for Packet

§

impl Send for Packet

§

impl Sync for Packet

§

impl Unpin for Packet

§

impl UnwindSafe for Packet

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> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

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

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

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>,

§

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>,

§

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.