pub struct WasmDecorationSource { /* private fields */ }Expand description
An async gutter-decoration producer over a plugin’s DecorationClient.
Cheap to clone (the client is an mpsc Sender clone); every clone talks to
the same actor / Store.
Implementations§
Source§impl WasmDecorationSource
impl WasmDecorationSource
Sourcepub fn new(client: DecorationClient, signs: Option<SignRegistryHandle>) -> Self
pub fn new(client: DecorationClient, signs: Option<SignRegistryHandle>) -> Self
Build the adapter over a client bridge. (No connect/spec round-trip
like completion — a decoration provider has no id/doc metadata; it is a
pure producer keyed by the mode that owns it.)
Sourcepub async fn gutter_decorations(
&self,
buffer_id: u64,
path: Option<&Path>,
line_count: u32,
) -> Result<Vec<GutterDecoration>, String>
pub async fn gutter_decorations( &self, buffer_id: u64, path: Option<&Path>, line_count: u32, ) -> Result<Vec<GutterDecoration>, String>
Produce the per-line gutter decorations for a buffer — the async producer
the host calls OFF the render path. Projects the owned
decoration-context from the
buffer metadata, calls the guest, and converts the result to native
GutterDecorations.
Graceful (§8, no flicker): the outer host error (trap / plugin-gone) and
the inner guest WIT err both collapse to the String the caller logs —
on an Err, the caller keeps the buffer’s prior cached snapshot rather
than clearing it, so decoration cues never blink mid-refresh. A candidate
that fails to cross (malformed record) fails the whole batch as a typed
error, never a silent drop.
Trait Implementations§
Source§impl AsyncGutterDecorationSource for WasmDecorationSource
PL8.E: expose the WASM producer as the native
AsyncGutterDecorationSource the
host’s decoration registry holds — the same trait-object indirection the
completion (AsyncCompletionSource) and picker (PickerSourceGenerator)
seams use, so lattice-host and the renderers never name this crate.
impl AsyncGutterDecorationSource for WasmDecorationSource
PL8.E: expose the WASM producer as the native
AsyncGutterDecorationSource the
host’s decoration registry holds — the same trait-object indirection the
completion (AsyncCompletionSource) and picker (PickerSourceGenerator)
seams use, so lattice-host and the renderers never name this crate.
Source§fn source_id(&self) -> u64
fn source_id(&self) -> u64
GutterDecorationSourceRegistry::unregister). Two producers with the
same id are the same plugin (reload replaces rather than duplicates).Source§fn produce(
&self,
buffer_id: u64,
path: Option<PathBuf>,
line_count: u32,
) -> DecorationFuture<'_>
fn produce( &self, buffer_id: u64, path: Option<PathBuf>, line_count: u32, ) -> DecorationFuture<'_>
path is
the buffer’s on-disk path when it has one (a provider may key marks off
it); line_count bounds the addressable lines. See DecorationFuture
for the Ok/Err contract.Source§impl Clone for WasmDecorationSource
impl Clone for WasmDecorationSource
Source§fn clone(&self) -> WasmDecorationSource
fn clone(&self) -> WasmDecorationSource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for WasmDecorationSource
impl !UnwindSafe for WasmDecorationSource
impl Freeze for WasmDecorationSource
impl Send for WasmDecorationSource
impl Sync for WasmDecorationSource
impl Unpin for WasmDecorationSource
impl UnsafeUnpin for WasmDecorationSource
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