pub struct BufferEntry {
pub id: BufferId,
pub flags: BufferFlags,
pub data: BufferData,
pub name: Option<String>,
}Expand description
One slot in the registry. The kind-specific data lives in
BufferData; flags + id + name apply uniformly.
name is the buffer’s synthetic display label when there is
no physical file backing it. For path-backed Documents it
stays None and the status line / picker fall back to the
path. For synthetic buffers like *lsp*, *messages*, or
*lsp:rust-analyzer:lattice*, the owning subsystem sets the
name at construction time; the status line + :ls + buffer
picker all surface that label uniformly. Help buffers carry
their own title field (used by help-mode link / anchor
machinery) and don’t use name.
Fields§
§id: BufferId§flags: BufferFlags§data: BufferData§name: Option<String>Implementations§
Source§impl BufferEntry
impl BufferEntry
pub fn kind(&self) -> BufferKind
Sourcepub fn document(&self) -> Option<&DocumentEntry>
pub fn document(&self) -> Option<&DocumentEntry>
The Document storage for any document-shaped kind.
Returns Some for BufferData::Document,
BufferData::Messages, BufferData::Multibuffer, and
(PU.1a) BufferData::Help — their storage is identical
(all carry Arc<dyn Document>); None for other kinds.
Code that needs to distinguish branches on Self::kind.
pub fn document_mut(&mut self) -> Option<&mut DocumentEntry>
pub fn terminal(&self) -> Option<&TerminalBuffer>
pub fn terminal_mut(&mut self) -> Option<&mut TerminalBuffer>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for BufferEntry
impl !UnwindSafe for BufferEntry
impl Freeze for BufferEntry
impl Send for BufferEntry
impl Sync for BufferEntry
impl Unpin for BufferEntry
impl UnsafeUnpin for BufferEntry
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 more