pub struct ListSubscription {
    pub pk: i64,
    pub list: i64,
    pub address: String,
    pub name: Option<String>,
    pub account: Option<i64>,
    pub enabled: bool,
    pub verified: bool,
    pub digest: bool,
    pub hide_address: bool,
    pub receive_duplicates: bool,
    pub receive_own_posts: bool,
    pub receive_confirmation: bool,
}
Expand description

A mailing list subscription entry.

Fields§

§pk: i64

Database primary key.

§list: i64

Mailing list foreign key (See MailingList).

§address: String

Subscription’s e-mail address.

§name: Option<String>

Subscription’s name, optional.

§account: Option<i64>

Subscription’s account foreign key, optional.

§enabled: bool

Whether this subscription is enabled.

§verified: bool

Whether the e-mail address is verified.

§digest: bool

Whether subscription wishes to receive list posts as a periodical digest e-mail.

§hide_address: bool

Whether subscription wishes their e-mail address hidden from public view.

§receive_duplicates: bool

Whether subscription wishes to receive mailing list post duplicates, i.e. posts addressed to them and the mailing list to which they are subscribed.

§receive_own_posts: bool

Whether subscription wishes to receive their own mailing list posts from the mailing list, as a confirmation.

§receive_confirmation: bool

Whether subscription wishes to receive a plain confirmation for their own mailing list posts.

Implementations§

source§

impl ListSubscription

source

pub fn address(&self) -> Address

Subscription address as a [melib::Address]

Examples found in repository?
core/src/models.rs (line 519)
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
    fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result {
        write!(
            fmt,
            "{} [digest: {}, hide_address: {} verified: {} {}]",
            self.address(),
            self.digest,
            self.hide_address,
            self.verified,
            if self.enabled {
                "enabled"
            } else {
                "not enabled"
            },
        )
    }
More examples
Hide additional examples
core/src/message_filters.rs (line 360)
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
    fn feed<'p, 'list>(
        self: Box<Self>,
        post: &'p mut PostEntry,
        ctx: &'p mut ListContext<'list>,
    ) -> std::result::Result<(&'p mut PostEntry, &'p mut ListContext<'list>), ()> {
        trace!("Running FinalizeRecipients filter");
        let mut recipients = vec![];
        let mut digests = vec![];
        let email_from = post.from.get_email();
        for subscription in ctx.subscriptions {
            trace!("examining subscription {:?}", &subscription);
            if subscription.address == email_from {
                trace!("subscription is submitter");
            }
            if subscription.digest {
                if subscription.address != email_from || subscription.receive_own_posts {
                    trace!("Subscription gets digest");
                    digests.push(subscription.address());
                }
                continue;
            }
            if subscription.address != email_from || subscription.receive_own_posts {
                trace!("Subscription gets copy");
                recipients.push(subscription.address());
            }
        }
        ctx.scheduled_jobs.push(MailJob::Send { recipients });
        if !digests.is_empty() {
            ctx.scheduled_jobs.push(MailJob::StoreDigest {
                recipients: digests,
            });
        }
        post.action = PostAction::Accept;
        Ok((post, ctx))
    }

Trait Implementations§

source§

impl Clone for ListSubscription

source§

fn clone(&self) -> ListSubscription

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 ListSubscription

source§

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

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

impl<'de> Deserialize<'de> for ListSubscription

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 ListSubscription

source§

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

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

impl From<ListOwner> for ListSubscription

source§

fn from(val: ListOwner) -> Self

Converts to this type from the input type.
source§

impl PartialEq<ListSubscription> for ListSubscription

source§

fn eq(&self, other: &ListSubscription) -> 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 ListSubscription

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

impl Eq for ListSubscription

source§

impl StructuralEq for ListSubscription

source§

impl StructuralPartialEq for ListSubscription

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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 Twhere 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> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

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

impl<T, U> TryFrom<U> for Twhere 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 Twhere 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<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,