Skip to main content

Smimea

Struct Smimea 

Source
pub struct Smimea<'a> {
    pub usage: TlsaCertUsage,
    pub selector: TlsaSelector,
    pub matching_type: TlsaMatchingType,
    pub data: &'a [u8],
}
Expand description

SMIMEA record data: an S/MIME certificate association, in the TLSA format (RFC 8162 §2).

Fields§

§usage: TlsaCertUsage

How the association is used (RFC 6698 §2.1.1).

§selector: TlsaSelector

Which part of the certificate is matched (RFC 6698 §2.1.2).

§matching_type: TlsaMatchingType

How the association data is presented (RFC 6698 §2.1.3).

§data: &'a [u8]

The certificate association data: the rest of the RDATA (RFC 6698 §2.1.4).

Implementations§

Source§

impl<'a> Smimea<'a>

Source

pub const fn new( usage: TlsaCertUsage, selector: TlsaSelector, matching_type: TlsaMatchingType, data: &'a [u8], ) -> Self

Builds the record data from its fields (RFC 6698 §2.1).

Trait Implementations§

Source§

impl<'a> Clone for Smimea<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl ComposeRdata for Smimea<'_>

Source§

fn rtype(&self) -> Rtype

The record type of this data.
Source§

fn compose_rdata<C: Composer + ?Sized>(&self, c: &mut C) -> Result<()>

Writes the RDATA (without the RDLENGTH prefix) to c. Read more
Source§

impl<'a> Copy for Smimea<'a>

Source§

impl<'a> Debug for Smimea<'a>

Source§

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

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

impl Display for Smimea<'_>

Source§

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

usage selector matching-type data-hex (RFC 6698 §2.2). An empty association has no such form and is written in the generic RFC 3597 §5 form instead.

Source§

impl<'a> Eq for Smimea<'a>

Source§

impl<'a> Hash for Smimea<'a>

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<'a> ParseRdata<'a> for Smimea<'a>

Source§

const RTYPE: Rtype = Rtype::SMIMEA

The record type this implementation handles.
Source§

fn parse_rdata(rdata: &mut WireReader<'a>) -> Result<Self>

Parses RDATA from rdata, a reader whose window is exactly the record’s RDATA (RDLENGTH bytes) but which can still follow compression pointers into the whole message. Read more
Source§

const CLASS: Option<Class> = None

For class-specific types (RFC 3597 §4: “class-specific” RDATA such as A and AAAA, whose format is only defined in class IN), the class the format is defined for. Records of another class are left as RData::Unknown. None (the default) means class-independent.
Source§

impl ParseRdataText for Smimea<'_>

Source§

fn parse_text<B: OutBuf + ?Sized>( s: &mut Scanner<'_>, out: &mut B, ) -> Result<()>

<usage> <selector> <matching-type> <data> (RFC 6698 §2.2): three decimal numbers and the association data in hexadecimal, which may be split across blanks and lines. At least one octet is required (empty data has only the generic form, as in BIND).

Source§

fn from_text<'b>(text: &str, buf: &'b mut [u8]) -> Result<Self>
where Self: ParseRdata<'b>,

Parses standalone presentation-format RDATA (relative names are completed with the root; newlines are blanks) into buf and returns a view over it. The RFC 3597 generic form \# <length> <hex> is accepted too. Read more
Source§

impl<'a> PartialEq for Smimea<'a>

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl<'a> StructuralPartialEq for Smimea<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Smimea<'a>

§

impl<'a> RefUnwindSafe for Smimea<'a>

§

impl<'a> Send for Smimea<'a>

§

impl<'a> Sync for Smimea<'a>

§

impl<'a> Unpin for Smimea<'a>

§

impl<'a> UnsafeUnpin for Smimea<'a>

§

impl<'a> UnwindSafe for Smimea<'a>

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> ToOwned for T
where T: Clone,

Source§

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

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

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.