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§
Sourcefn id(&self) -> &'static str
fn id(&self) -> &'static str
Its key in the session document (views[i].plugins.<id>) and in logs.
fn name(&self) -> &'static str
Provided Methods§
fn opener(&self) -> Option<&dyn SourceOpener>
Sourcefn synthetic(
&self,
_channels: usize,
_sample_rate: f64,
_duration_sec: f64,
) -> Option<Result<Arc<dyn RecordingSource>>>
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).
Sourcefn install(&self, _store: &Entity<Store>, _cx: &mut App)
fn install(&self, _store: &Entity<Store>, _cx: &mut App)
Called once the store exists (subscribe to its events, create the plugin’s state).
Sourcefn trace_overlay(
&self,
_store: &Store,
_view: &ViewDoc,
_window_sec: Range<f64>,
_cx: &App,
) -> Option<TraceOverlay>
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.
Sourcefn raster(
&self,
_store: &Store,
_view: &ViewDoc,
_window_sec: Range<f64>,
_cx: &App,
) -> Option<Raster>
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.
Sourcefn layers(&self, _store: &Store, _view: &ViewDoc, _cx: &App) -> Layers
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).
Sourcefn recording_epochs(&self, _path: &Path, _start_sec: f64) -> Vec<EpochDoc>
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.
Sourcefn aligned(
&self,
_store: &Entity<Store>,
_events_s: &[f64],
_pre_ms: f64,
_post_ms: f64,
_window: &mut Window,
_cx: &mut App,
) -> Option<AnyElement>
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).
Sourcefn workspace(
&self,
_ws: Workspace,
_store: &Entity<Store>,
_window: &mut Window,
_cx: &mut App,
) -> Option<AnyView>
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.
Sourcefn provides(&self, _ws: Workspace) -> bool
fn provides(&self, _ws: Workspace) -> bool
Whether this plugin provides workspace ws (its tab is shown).
Sourcefn panel(&self) -> Option<(&'static str, Rc<dyn Fn() -> Icon>)>
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).
Sourcefn view_section(
&self,
_store: &Entity<Store>,
_view: &ViewDoc,
_window: &mut Window,
_cx: &mut App,
) -> Option<AnyElement>
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".