1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
 */

//! This module contains the basic building blog of [`fetcher`](`crate`) - [`Entry`]
//! that is passed throughout the program and that all modules either create, modify, or consume

// TODO: add message history via responce id -> message id hashmap

use crate::sink::Message;

/// A [`fetcher`](`crate`) primitive that contains a message and an id returned from a source that can be send to a sink
#[derive(Clone, Default, Debug)]
pub struct Entry {
	/// An optional id of that entry. A [`ReadFilter`](`crate::read_filter::ReadFilter`) can use it to differentiate already read entries from the unread ones
	pub id: Option<String>, // TODO: add date id type

	/// Raw contents gotten from a [`Source`](`crate::source::Source`)
	///
	/// It's used to compose a message using [`transformators`](`crate::action::transform::Transform`).
	pub raw_contents: Option<String>,

	/// The message itself
	pub msg: Message,
}