pub struct HelpContent {
pub buffer: HelpBuffer,
pub metadata: HelpMetadata,
}Expand description
M.3.2.c.5: pair of (slim help buffer, parsed metadata) returned from every help factory. The App splits this into:
buffer->App.popup_buffer(the popup hot-path slot)metadata->App.buffer_locals[buffer.id]viaseed_help_metadata_localsat popup-open time.
Fields§
§buffer: HelpBuffer§metadata: HelpMetadataImplementations§
Source§impl HelpContent
impl HelpContent
Sourcepub fn scroll_to_anchor(&mut self, name: &str) -> bool
pub fn scroll_to_anchor(&mut self, name: &str) -> bool
Scroll to a named anchor in the metadata. Returns true if
the anchor was found and the buffer’s scroll advanced.
Reads metadata.anchors (the canonical owner of help
per-buffer state per M.3.2.c.5); production code paths
scroll through this method or, when working from a registry
slot, by looking up HelpAnchors in buffer_locals.
Source§impl HelpContent
impl HelpContent
Sourcepub fn from_lines(title: impl Into<String>, lines: Vec<String>) -> Self
pub fn from_lines(title: impl Into<String>, lines: Vec<String>) -> Self
Build a help buffer from a list of pre-formatted lines.
Lines may contain [label](scheme:value) markdown links –
the parser indexes them into the returned metadata’s links
vec at the label’s byte range in the joined output. No syntax
highlighting is attached – help buffers receive their syntax
and link styling from the live cells-worker DisplayMatrix
(link spans seeded via link_highlights into the buffer’s
ExtraHighlights local).
Sourcepub fn from_lines_and_anchors(
title: impl Into<String>,
lines: Vec<String>,
anchors: Vec<HelpAnchor>,
) -> Self
pub fn from_lines_and_anchors( title: impl Into<String>, lines: Vec<String>, anchors: Vec<HelpAnchor>, ) -> Self
Build with explicit anchors. Used by the introspection
renderer to feed RenderedIntrospection.anchors through.
Methods from Deref<Target = HelpBuffer>§
Sourcepub fn line_count(&self) -> u32
pub fn line_count(&self) -> u32
Number of visible content lines (the popup renderer uses this to clamp scroll). CV.3: content space, as the name already promised — it was reading ropey’s raw count, which let the scroll clamp reach one row past the last help line.
Trait Implementations§
Source§impl Clone for HelpContent
impl Clone for HelpContent
Source§fn clone(&self) -> HelpContent
fn clone(&self) -> HelpContent
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 HelpContent
impl Debug for HelpContent
Source§impl Deref for HelpContent
impl Deref for HelpContent
Source§type Target = HelpBuffer
type Target = HelpBuffer
Source§fn deref(&self) -> &HelpBuffer
fn deref(&self) -> &HelpBuffer
Source§impl DerefMut for HelpContent
impl DerefMut for HelpContent
Source§fn deref_mut(&mut self) -> &mut HelpBuffer
fn deref_mut(&mut self) -> &mut HelpBuffer
Auto Trait Implementations§
impl Freeze for HelpContent
impl RefUnwindSafe for HelpContent
impl Send for HelpContent
impl Sync for HelpContent
impl Unpin for HelpContent
impl UnsafeUnpin for HelpContent
impl UnwindSafe for HelpContent
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,
§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