Skip to main content

BookmarkSource

Trait BookmarkSource 

Source
pub trait BookmarkSource: Send + Sync {
    // Required methods
    fn kind(&self) -> SourceKind;
    fn list(&self) -> Result<Vec<Bookmark>, CoreError>;
    fn list_paginated(
        &self,
        cursor: Option<String>,
        limit: usize,
    ) -> Result<Page, CoreError>;
    fn by_canonical(
        &self,
        canonical: &str,
    ) -> Result<Option<Bookmark>, CoreError>;
}
Expand description

Read-side trait. Implemented by every bridge.

Required Methods§

Source

fn kind(&self) -> SourceKind

What kind of source this is.

Source

fn list(&self) -> Result<Vec<Bookmark>, CoreError>

List all bookmarks. May be expensive for large stores; prefer list_paginated for production reads.

Source

fn list_paginated( &self, cursor: Option<String>, limit: usize, ) -> Result<Page, CoreError>

Paginated listing. Cursor is opaque; first call uses None.

Source

fn by_canonical(&self, canonical: &str) -> Result<Option<Bookmark>, CoreError>

Look up a single bookmark by canonical URL.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§