Record browsing history in core
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
use std::time::SystemTime;
|
||||
|
||||
use crate::{ProfileId, SpaceId, UrlText};
|
||||
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub struct HistoryEntry {
|
||||
profile_id: ProfileId,
|
||||
space_id: SpaceId,
|
||||
title: String,
|
||||
url: UrlText,
|
||||
visited_at: SystemTime,
|
||||
}
|
||||
|
||||
impl HistoryEntry {
|
||||
#[must_use]
|
||||
pub fn new(
|
||||
profile_id: ProfileId,
|
||||
space_id: SpaceId,
|
||||
title: impl Into<String>,
|
||||
url: UrlText,
|
||||
visited_at: SystemTime,
|
||||
) -> Self {
|
||||
Self { profile_id, space_id, title: title.into(), url, visited_at }
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn profile_id(&self) -> &ProfileId {
|
||||
&self.profile_id
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn space_id(&self) -> &SpaceId {
|
||||
&self.space_id
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn title(&self) -> &str {
|
||||
&self.title
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn url(&self) -> &UrlText {
|
||||
&self.url
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn visited_at(&self) -> SystemTime {
|
||||
self.visited_at
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
mod archive;
|
||||
mod command;
|
||||
mod error;
|
||||
mod history;
|
||||
mod identifiers;
|
||||
mod profile;
|
||||
mod space;
|
||||
@@ -11,6 +12,7 @@ mod url_text;
|
||||
pub use archive::{ArchiveSource, ArchivedTab};
|
||||
pub use command::{CommandIntent, CommandScope};
|
||||
pub use error::DomainError;
|
||||
pub use history::HistoryEntry;
|
||||
pub use identifiers::{ProfileId, SpaceId, SplitId, TabId, WebViewId};
|
||||
pub use profile::{Profile, ProfileKind};
|
||||
pub use space::{ArchivePolicy, Space};
|
||||
|
||||
Reference in New Issue
Block a user