pub struct OmniboxEngine {
pub bookmarks: Vec<Bookmark>,
pub history: Vec<HistoryEntry>,
}Expand description
Omnibox サジェスト・ブックマーク・履歴管理エンジン(純粋ロジック)
Fields§
§bookmarks: Vec<Bookmark>§history: Vec<HistoryEntry>Implementations§
Source§impl OmniboxEngine
impl OmniboxEngine
pub fn new() -> Self
Sourcepub fn add_bookmark(&mut self, title: &str, url: &str) -> bool
pub fn add_bookmark(&mut self, title: &str, url: &str) -> bool
ブックマーク追加(既に同一 URL があればタイトル更新して true を返す)
Sourcepub fn remove_bookmark(&mut self, url: &str) -> bool
pub fn remove_bookmark(&mut self, url: &str) -> bool
ブックマーク削除
Sourcepub fn is_bookmarked(&self, url: &str) -> bool
pub fn is_bookmarked(&self, url: &str) -> bool
ブックマーク登録状態の確認
Sourcepub fn toggle_bookmark(&mut self, title: &str, url: &str) -> bool
pub fn toggle_bookmark(&mut self, title: &str, url: &str) -> bool
ブックマーク登録のトグル(未登録なら追加、登録済みなら削除)
Sourcepub fn record_visit(&mut self, title: &str, url: &str)
pub fn record_visit(&mut self, title: &str, url: &str)
ページ訪問履歴を記録
Sourcepub fn get_suggestions(
&self,
query: &str,
search_suggestions: &[String],
max_items: usize,
) -> Vec<OmniboxItem>
pub fn get_suggestions( &self, query: &str, search_suggestions: &[String], max_items: usize, ) -> Vec<OmniboxItem>
入力クエリに対する統合サジェスト候補を生成
優先順位:
- ブックマーク(タイトルまたは URL にクエリが含まれるもの)
- 閲覧履歴(訪問回数および直近順)
- Web 検索候補 (DuckDuckGo サジェスト)
Trait Implementations§
Source§impl Clone for OmniboxEngine
impl Clone for OmniboxEngine
Source§fn clone(&self) -> OmniboxEngine
fn clone(&self) -> OmniboxEngine
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OmniboxEngine
impl Debug for OmniboxEngine
Auto Trait Implementations§
impl Freeze for OmniboxEngine
impl RefUnwindSafe for OmniboxEngine
impl Send for OmniboxEngine
impl Sync for OmniboxEngine
impl Unpin for OmniboxEngine
impl UnsafeUnpin for OmniboxEngine
impl UnwindSafe for OmniboxEngine
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
Mutably borrows from an owned value. Read more