Skip to main content

RecoveryEmailParts

Struct RecoveryEmailParts 

Source
#[non_exhaustive]
pub struct RecoveryEmailParts<'a> {
Show 16 fields pub app_name: &'a str, pub app_tagline: Option<&'a str>, pub title: &'a str, pub greeting_name: &'a str, pub intro: &'a str, pub cta_label: &'a str, pub cta_url: &'a str, pub fine_print: &'a str, pub when: DateTime<Utc>, pub request_ip: Option<&'a str>, pub ua_summary: Option<&'a str>, pub correlation_id: Option<&'a str>, pub signature_primary: Option<&'a str>, pub signature_title: Option<&'a str>, pub support_email: Option<&'a str>, pub show_powered_by: bool,
}
Expand description

Structured inputs to render_recovery_html. Kept separate from Mail so the framework’s HTML email surface stays declarative — call-sites pass labelled fields rather than a long positional argument list.

#[non_exhaustive] so future additions (e.g. a project- supplied accent override, a footer-link tuple) are SemVer-safe.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§app_name: &'a str

User-facing product identity, e.g. "Library Circulation". Required for production: never set this to a framework name. Renders as the brand wordmark, in the security envelope’s “System” row, and in the email footer.

§app_tagline: Option<&'a str>

Optional descriptor under the wordmark — e.g. "Operational library management". None falls back to "Account security notification".

§title: &'a str§greeting_name: &'a str

Greeting label resolved by the caller via the documented display_name → first_name → email-local-part → "there" fallback. Rendered as "Hello {greeting_name},".

§intro: &'a str§cta_label: &'a str§cta_url: &'a str§fine_print: &'a str§when: DateTime<Utc>§request_ip: Option<&'a str>§ua_summary: Option<&'a str>§correlation_id: Option<&'a str>

Per-request correlation id (UUID v7). The framework derives a 6-character reference from its last hex chars and renders it inside a security-style panel — operators can match the reference to the audit row, and the visual block stays compatible with a future MFA verification-code shape. None hides the reference panel.

§signature_primary: Option<&'a str>

Account-owner signature primary line (“Abdulwahed Mansour” or a name-equivalent). None hides the signature block.

§signature_title: Option<&'a str>

Optional secondary signature line (job title).

§support_email: Option<&'a str>

Optional support contact surfaced in the email footer.

§show_powered_by: bool

true → render the low-key “Powered by RustIO” footer credit. Off by default; the framework name stays invisible.

Implementations§

Source§

impl<'a> RecoveryEmailParts<'a>

Source

pub fn new( app_name: &'a str, title: &'a str, greeting_name: &'a str, intro: &'a str, cta_url: &'a str, fine_print: &'a str, when: DateTime<Utc>, ) -> Self

Construct a RecoveryEmailParts with sensible defaults for the optional fields. Required fields are positional; everything else lands in a safe “none”/default state and callers mutate the public field directly.

Lets external crates (the CLI’s doctor email --html-preview, project-side test scaffolding) construct the struct around its #[non_exhaustive] attribute.

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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

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

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more