pub struct OutboundEmailPolicy { /* private fields */ }Expand description
Boot-resolved recipient policy shared by comm admission and email delivery. An absent policy permits queuing without claiming that delivery is configured.
Implementations§
Source§impl OutboundEmailPolicy
impl OutboundEmailPolicy
Sourcepub fn configured(recipients: Vec<String>) -> Result<Self, String>
pub fn configured(recipients: Vec<String>) -> Result<Self, String>
Install a normalized recipient set; an explicitly empty set denies all recipients.
pub fn is_configured(&self) -> bool
pub fn allows(&self, recipient: &str) -> bool
pub fn allows_external_sender(&self, actor_id: &str) -> bool
pub fn has_external_senders(&self) -> bool
pub fn external_daily_cap(&self) -> Option<u64>
pub async fn lock_external_admission(&self) -> OwnedMutexGuard<()>
Sourcepub fn recipient_key(&self, normalized_recipient: &str) -> Option<String>
pub fn recipient_key(&self, normalized_recipient: &str) -> Option<String>
The recipient key a recipient_key suppression entry matches, derived on demand as
HMAC-SHA256(K_rk, normalized address) in lowercase hex; the raw bytes are never stored.
None when no recipient-key secret is configured (external senders unset).
The footer text for external messages, or the reason it is unavailable. None while
external senders are unset.
Sourcepub fn mint_unsubscribe_token(
&self,
normalized_recipient: &str,
) -> Option<String>
pub fn mint_unsubscribe_token( &self, normalized_recipient: &str, ) -> Option<String>
Mint the unsubscribe token for a normalized external recipient, or None when the
recipient-key secret or any token key is unavailable. The highest configured key id mints.
Sourcepub fn verify_unsubscribe_token(&self, token: &str) -> Option<String>
pub fn verify_unsubscribe_token(&self, token: &str) -> Option<String>
Verify an unsubscribe token and return the recipient key text it identifies, or None
on any malformed input or tag mismatch. Retired key ids keep verifying.
Trait Implementations§
Source§impl Clone for OutboundEmailPolicy
impl Clone for OutboundEmailPolicy
Auto Trait Implementations§
impl !RefUnwindSafe for OutboundEmailPolicy
impl !UnwindSafe for OutboundEmailPolicy
impl Freeze for OutboundEmailPolicy
impl Send for OutboundEmailPolicy
impl Sync for OutboundEmailPolicy
impl Unpin for OutboundEmailPolicy
impl UnsafeUnpin for OutboundEmailPolicy
Blanket Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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