pub struct ScanClient { /* private fields */ }Expand description
The Send + Sync handle a caller holds. Cloning is cheap; every clone
talks to the same actor / Store, so calls serialise on the
single-consumer loop the !Sync Store requires — which is exactly what
begin-then-scan needs.
Implementations§
Source§impl ScanClient
impl ScanClient
pub fn id(&self) -> PluginId
Sourcepub async fn extensions(&self) -> Result<Vec<String>, PluginHostError>
pub async fn extensions(&self) -> Result<Vec<String>, PluginHostError>
Call the guest’s extensions(). Once, at load.
Sourcepub async fn view_mode(&self) -> Result<Option<String>, PluginHostError>
pub async fn view_mode(&self) -> Result<Option<String>, PluginHostError>
Call the guest’s view-mode(). Once, at load.
Sourcepub async fn roots(&self) -> Result<Vec<String>, PluginHostError>
pub async fn roots(&self) -> Result<Vec<String>, PluginHostError>
AF.1: call the guest’s roots(). Per scan, not once at load — the
answer comes from user configuration and must follow a :set.
Sourcepub async fn begin(&self, args: Vec<String>) -> Result<u64, PluginHostError>
pub async fn begin(&self, args: Vec<String>) -> Result<u64, PluginHostError>
Call the guest’s begin() — the start of a scan. Returns the guest’s
generation key (OT.3b): an opaque u64 that changes when anything
scan-wide would change its rows, so the host can invalidate cached
results without knowing what those things are.
OA.11a: args are the view’s own scan arguments, forwarded verbatim.
Sourcepub async fn describe(
&self,
args: Vec<String>,
) -> Result<String, PluginHostError>
pub async fn describe( &self, args: Vec<String>, ) -> Result<String, PluginHostError>
OA.22: ask the guest what this view IS, for the headerline.
Called once per scan, after Self::begin, so the guest sees the args
begin stashed. The host cannot answer this itself: it deliberately
does not read args, so a filtered agenda would otherwise look exactly
like an unfiltered one.
Sourcepub async fn scan(
&self,
path: String,
text: String,
) -> Result<Result<ScanResult, String>, PluginHostError>
pub async fn scan( &self, path: String, text: String, ) -> Result<Result<ScanResult, String>, PluginHostError>
Call the guest’s scan(path, text).
The outer result is the host surface (trap / gone / quarantined); the
inner Result<_, String> is the guest’s own WIT result. Either way
the caller skips THIS FILE and continues — one bad file must not fail
the agenda.
Trait Implementations§
Source§impl Clone for ScanClient
impl Clone for ScanClient
Source§fn clone(&self) -> ScanClient
fn clone(&self) -> ScanClient
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 ScanClient
impl !UnwindSafe for ScanClient
impl Freeze for ScanClient
impl Send for ScanClient
impl Sync for ScanClient
impl Unpin for ScanClient
impl UnsafeUnpin for ScanClient
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