pub struct BufferInfo {
pub id: BufferId,
pub path: Option<PathBuf>,
pub modified: bool,
pub length: usize,
pub is_virtual: bool,
pub view_mode: String,
pub is_composing_in_any_split: bool,
pub compose_width: Option<u16>,
pub language: String,
pub is_preview: bool,
pub splits: Vec<SplitId>,
}Expand description
Information about a buffer
Fields§
§id: BufferIdBuffer ID
path: Option<PathBuf>File path (if any)
modified: boolWhether the buffer has been modified
length: usizeLength of buffer in bytes
is_virtual: boolWhether this is a virtual buffer (not backed by a file)
view_mode: StringCurrent view mode of the active split: “source” or “compose”
is_composing_in_any_split: boolTrue if any split showing this buffer has compose mode enabled.
Plugins should use this (not view_mode) to decide whether to maintain
decorations, since decorations live on the buffer and are filtered
per-split at render time.
compose_width: Option<u16>Compose width (if set), from the active split’s view state
language: StringThe detected language for this buffer (e.g., “rust”, “markdown”, “text”)
is_preview: boolWhether this tab was opened in “preview” (ephemeral) mode — true when opened via single-click in the file explorer and not yet committed (no edit, no double-click, no tab-click, no layout change). Plugins that react to buffer lifecycle events should generally treat preview buffers as transient; e.g. a diagnostics panel may want to skip refreshing itself for a preview tab.
splits: Vec<SplitId>Split ids that currently hold this buffer (empty when the buffer is
open but not visible in any split — e.g. background-opened tabs
that haven’t been focused). Lets plugins implement “focus existing
buffer if visible, else open new” without having to track split
ids across editor restarts (which reassign them). The list is a
snapshot at the last update_plugin_state_snapshot tick.
Trait Implementations§
Source§impl Clone for BufferInfo
impl Clone for BufferInfo
Source§fn clone(&self) -> BufferInfo
fn clone(&self) -> BufferInfo
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 BufferInfo
impl Debug for BufferInfo
Source§impl<'de> Deserialize<'de> for BufferInfo
impl<'de> Deserialize<'de> for BufferInfo
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 Serialize for BufferInfo
impl Serialize for BufferInfo
Source§impl TS for BufferInfo
impl TS for BufferInfo
Source§type WithoutGenerics = BufferInfo
type WithoutGenerics = BufferInfo
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 = BufferInfo
type OptionInnerType = BufferInfo
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(cfg: &Config) -> String
fn decl_concrete(cfg: &Config) -> String
TS::decl().
If this type is not generic, then this function is equivalent to TS::decl().Source§fn decl(cfg: &Config) -> String
fn decl(cfg: &Config) -> String
type User = { user_id: number, ... }.
This function will panic if the type has no declaration. Read moreSource§fn inline(cfg: &Config) -> String
fn inline(cfg: &Config) -> String
{ user_id: number }.
This function will panic if the type cannot be inlined.Source§fn inline_flattened(cfg: &Config) -> String
fn inline_flattened(cfg: &Config) -> String
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, relative to the output directory.
The returned path does not include any base directory. 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(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
fn dependencies(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
Source§fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export_all. Read moreSource§fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export. Read more