Skip to main content

ProfileSyncHandler

Trait ProfileSyncHandler 

Source
pub trait ProfileSyncHandler: Send + Sync {
    // Provided methods
    fn on_profile_fetched(
        &self,
        _slim: &SlimProfile,
        _avatar_url: &str,
        _banner_url: &str,
    ) { ... }
    fn forget_images(&self, _images: Vec<CachedImage>) { ... }
}
Expand description

Callback trait for platform-specific profile sync work.

The core load_profile handles relay fetching, STATE updates, and EventEmitter notifications. This trait covers what differs per platform:

  • DB persistence (SQLite upsert)
  • Image caching (avatar/banner download + disk cache)

Provided Methods§

Source

fn on_profile_fetched( &self, _slim: &SlimProfile, _avatar_url: &str, _banner_url: &str, )

Called after a profile is fetched from relays and updated in STATE. slim is ready for DB persistence. avatar_url/banner_url are for image caching (may be empty).

Source

fn forget_images(&self, _images: Vec<CachedImage>)

Delete a blocked profile’s cached pictures from disk. No other profile points at them.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§