Skip to main content

AppPlugin

Trait AppPlugin 

Source
pub trait AppPlugin:
    Send
    + Sync
    + 'static {
Show 14 methods // Required methods fn id(&self) -> &'static str; fn name(&self) -> &'static str; // Provided methods fn opener(&self) -> Option<&dyn SourceOpener> { ... } fn synthetic( &self, _channels: usize, _sample_rate: f64, _duration_sec: f64, ) -> Option<Result<Arc<dyn RecordingSource>>> { ... } fn install(&self, _store: &Entity<Store>, _cx: &mut App) { ... } fn trace_overlay( &self, _store: &Store, _view: &ViewDoc, _window_sec: Range<f64>, _cx: &App, ) -> Option<TraceOverlay> { ... } fn raster( &self, _store: &Store, _view: &ViewDoc, _window_sec: Range<f64>, _cx: &App, ) -> Option<Raster> { ... } fn layers(&self, _store: &Store, _view: &ViewDoc, _cx: &App) -> Layers { ... } fn recording_epochs(&self, _path: &Path, _start_sec: f64) -> Vec<EpochDoc> { ... } fn aligned( &self, _store: &Entity<Store>, _events_s: &[f64], _pre_ms: f64, _post_ms: f64, _window: &mut Window, _cx: &mut App, ) -> Option<AnyElement> { ... } fn workspace( &self, _ws: Workspace, _store: &Entity<Store>, _window: &mut Window, _cx: &mut App, ) -> Option<AnyView> { ... } fn provides(&self, _ws: Workspace) -> bool { ... } fn panel(&self) -> Option<(&'static str, Rc<dyn Fn() -> Icon>)> { ... } fn view_section( &self, _store: &Entity<Store>, _view: &ViewDoc, _window: &mut Window, _cx: &mut App, ) -> Option<AnyElement> { ... }
}
Expand description

A domain plugin. Every method has a default: a plugin implements what it adds.

Required Methods§

Source

fn id(&self) -> &'static str

Its key in the session document (views[i].plugins.<id>) and in logs.

Source

fn name(&self) -> &'static str

Provided Methods§

Source

fn opener(&self) -> Option<&dyn SourceOpener>

Source

fn synthetic( &self, _channels: usize, _sample_rate: f64, _duration_sec: f64, ) -> Option<Result<Arc<dyn RecordingSource>>>

A recording computed on demand (channels × duration_sec at sample_rate).

Source

fn install(&self, _store: &Entity<Store>, _cx: &mut App)

Called once the store exists (subscribe to its events, create the plugin’s state).

Source

fn trace_overlay( &self, _store: &Store, _view: &ViewDoc, _window_sec: Range<f64>, _cx: &App, ) -> Option<TraceOverlay>

Marks over the traces of session view view for the session-time window window_sec.

Source

fn raster( &self, _store: &Store, _view: &ViewDoc, _window_sec: Range<f64>, _cx: &App, ) -> Option<Raster>

Raster rows of session view view for the session-time window window_sec.

Source

fn layers(&self, _store: &Store, _view: &ViewDoc, _cx: &App) -> Layers

What this plugin can draw for session view view (e.g. a linked sorting: spikes, units).

Source

fn recording_epochs(&self, _path: &Path, _start_sec: f64) -> Vec<EpochDoc>

Epochs the recording file at path holds itself (electrophysiology: NWB’s /intervals tables), in seconds from the recording’s start, which is start_sec of the session.

Source

fn aligned( &self, _store: &Entity<Store>, _events_s: &[f64], _pre_ms: f64, _post_ms: f64, _window: &mut Window, _cx: &mut App, ) -> Option<AnyElement>

What it shows in Analytics aligned to events events_s (seconds of the open recording), pre_ms before to post_ms after each (electrophysiology: each unit’s raster and PETH).

Source

fn workspace( &self, _ws: Workspace, _store: &Entity<Store>, _window: &mut Window, _cx: &mut App, ) -> Option<AnyView>

The body of workspace ws when this plugin provides it.

Source

fn provides(&self, _ws: Workspace) -> bool

Whether this plugin provides workspace ws (its tab is shown).

Source

fn panel(&self) -> Option<(&'static str, Rc<dyn Fn() -> Icon>)>

Its panel on the right side bar: title and icon (its body is Self::view_section).

Source

fn view_section( &self, _store: &Entity<Store>, _view: &ViewDoc, _window: &mut Window, _cx: &mut App, ) -> Option<AnyElement>

The body of its panel for view.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§