pub struct PluginStaticConfig {
pub name: String,
pub category: Option<String>,
pub max_columns: Option<usize>,
pub max_cells: Option<usize>,
pub select_mode: ColumnSelectMode,
pub min_config_columns: Option<usize>,
pub config_column_names: Vec<String>,
pub group_rollup_modes: Option<Vec<GroupRollupMode>>,
pub priority: Option<i32>,
pub can_render_column_styles: bool,
}Expand description
Static, immutable configuration for a plugin.
Returned once per plugin from get_static_config() at registration
time and cached in [crate::renderer::PluginRecord]. Consumers
(renderer, session, queries, components) read these fields off the
renderer’s active-plugin metadata rather than calling back into JS.
<perspective-viewer> reads this exactly once per plugin (at
registerPlugin time) and caches it for the lifetime of the
application. The result must be stable; do not mutate any field
after registration.
Fields§
§name: StringThe unique key for this plugin. Used as the plugin field in a
ViewerConfig and as the display name key in the
<perspective-viewer> UI.
category: Option<String>Category in the plugin picker menu.
max_columns: Option<usize>Soft limit on the number of columns the plugin will render. Triggers the “Rendering N of M” warning when the view exceeds this value (until dismissed).
max_cells: Option<usize>Soft limit on the number of cells (rows × columns) the plugin will render. Triggers the “Rendering N of M” warning when the view exceeds this value (until dismissed).
select_mode: ColumnSelectModeColumn add/remove behavior. "select" exclusively selects the
added column, removing other columns. "toggle" toggles the
column on or off based on its current state, leaving other
columns alone.
min_config_columns: Option<usize>Minimum number of columns the plugin requires to render. Mostly
affects drag/drop and column-remove button behavior. undefined
is treated identically to 1.
config_column_names: Vec<String>Named column slots. Named columns have replace/swap behavior in
drag/drop rather than insert. The length must be at least
min_config_columns.
group_rollup_modes: Option<Vec<GroupRollupMode>>Group-rollup modes the plugin accepts, in preference order. The first entry that matches a feature flag becomes the default.
priority: Option<i32>Plugin load priority. Higher numbers win; ties resolve in
registration order. The highest-priority plugin is loaded by
default unless restore({ plugin }) overrides it.
can_render_column_styles: boolWhether this plugin opts into per-column style controls in the
settings sidebar. When true, the StyleTab is shown for active
columns and the plugin’s column_config_schema is queried for
the per-column field set. When false or omitted, no StyleTab
is shown.
Implementations§
Source§impl PluginStaticConfig
impl PluginStaticConfig
Sourcepub fn is_swap(&self, index: usize) -> bool
pub fn is_swap(&self, index: usize) -> bool
true if dropping a column at index should swap with the
column already there rather than insert. Only the named slots
(config_column_names[..len()-1]) participate in swap behaviour;
the trailing unnamed tail inserts.
pub fn get_group_rollups( &self, rollup_features: &[GroupRollupMode], ) -> Vec<GroupRollupMode>
Trait Implementations§
Source§impl Clone for PluginStaticConfig
impl Clone for PluginStaticConfig
Source§fn clone(&self) -> PluginStaticConfig
fn clone(&self) -> PluginStaticConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PluginStaticConfig
impl Debug for PluginStaticConfig
Source§impl Default for PluginStaticConfig
impl Default for PluginStaticConfig
Source§fn default() -> PluginStaticConfig
fn default() -> PluginStaticConfig
Source§impl<'de> Deserialize<'de> for PluginStaticConfig
impl<'de> Deserialize<'de> for PluginStaticConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for PluginStaticConfig
impl PartialEq for PluginStaticConfig
Source§fn eq(&self, other: &PluginStaticConfig) -> bool
fn eq(&self, other: &PluginStaticConfig) -> bool
self and other values to be equal, and is used by ==.Source§impl TS for PluginStaticConfig
impl TS for PluginStaticConfig
Source§type WithoutGenerics = PluginStaticConfig
type WithoutGenerics = PluginStaticConfig
WithoutGenerics should just be Self.
If the type does have generic parameters, then all generic parameters must be replaced with
a dummy type, e.g ts_rs::Dummy or ().
The only requirement for these dummy types is that EXPORT_TO must be None. Read moreSource§type OptionInnerType = PluginStaticConfig
type OptionInnerType = PluginStaticConfig
std::option::Option<T>, then this associated type is set to T.
All other implementations of TS should set this type to Self instead.Source§fn docs() -> Option<String>
fn docs() -> Option<String>
TS is derived, docs are
automatically read from your doc comments or #[doc = ".."] attributesSource§fn decl_concrete() -> String
fn decl_concrete() -> String
TS::decl().
If this type is not generic, then this function is equivalent to TS::decl().Source§fn decl() -> String
fn decl() -> String
type User = { user_id: number, ... }.
This function will panic if the type has no declaration. Read moreSource§fn inline() -> String
fn inline() -> String
{ user_id: number }.
This function will panic if the type cannot be inlined.Source§fn inline_flattened() -> String
fn inline_flattened() -> String
This function will panic if the type cannot be flattened.
Source§fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn output_path() -> Option<PathBuf>
fn output_path() -> Option<PathBuf>
T should be exported.The returned path does not include the base directory from
TS_RS_EXPORT_DIR. Read moreSource§fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn dependencies() -> Vec<Dependency>where
Self: 'static,
fn dependencies() -> Vec<Dependency>where
Self: 'static,
Source§fn export() -> Result<(), ExportError>where
Self: 'static,
fn export() -> Result<(), ExportError>where
Self: 'static,
TS::export_all. Read moreSource§fn export_all() -> Result<(), ExportError>where
Self: 'static,
fn export_all() -> Result<(), ExportError>where
Self: 'static,
To export only this type, without its dependencies, use
TS::export. Read moreSource§fn export_all_to(out_dir: impl AsRef<Path>) -> Result<(), ExportError>where
Self: 'static,
fn export_all_to(out_dir: impl AsRef<Path>) -> Result<(), ExportError>where
Self: 'static,
To export only this type, without its dependencies, use
TS::export. Read moreSource§fn export_to_string() -> Result<String, ExportError>where
Self: 'static,
fn export_to_string() -> Result<String, ExportError>where
Self: 'static,
impl StructuralPartialEq for PluginStaticConfig
Auto Trait Implementations§
impl Freeze for PluginStaticConfig
impl RefUnwindSafe for PluginStaticConfig
impl Send for PluginStaticConfig
impl Sync for PluginStaticConfig
impl Unpin for PluginStaticConfig
impl UnsafeUnpin for PluginStaticConfig
impl UnwindSafe for PluginStaticConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FromQuery for Twhere
T: DeserializeOwned,
impl<T> FromQuery for Twhere
T: DeserializeOwned,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
Source§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
self to a value of a Properties struct.Source§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
Source§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
self to a value of a Properties struct.