pub struct PickerClient { /* private fields */ }Expand description
The Send + Sync handle a host adapter (PH7.4c.2) holds. Cloning it is cheap
(an mpsc Sender clone); every clone talks to the same actor / Store, so
calls are serialized by the single-consumer loop — the guarantee the !Sync
Store needs. Dropping the last clone ends the actor loop (teardown).
Implementations§
Source§impl PickerClient
impl PickerClient
Sourcepub fn id(&self) -> PluginId
pub fn id(&self) -> PluginId
The host-issued identity of the plugin behind this client — the u32
inside its SourceLayer::Plugin(id) provenance.
Sourcepub async fn register_sources(
&self,
) -> Result<Vec<NativePickerSourceSpec>, PluginHostError>
pub async fn register_sources( &self, ) -> Result<Vec<NativePickerSourceSpec>, PluginHostError>
OR.5b: drive the guest’s register-picker-sources() and collect every
source it declared. Returns a typed host error
(PluginGone if the actor has ended,
Trap on fuel/epoch/wasm).
An empty list is not an error: a plugin that provides the seam and declares nothing registers nothing, which is what it asked for.
Sourcepub async fn init(
&self,
source: String,
ctx: PickerContext,
args: Vec<String>,
) -> Result<Result<Vec<CandidatePair>, String>, PluginHostError>
pub async fn init( &self, source: String, ctx: PickerContext, args: Vec<String>, ) -> Result<Result<Vec<CandidatePair>, String>, PluginHostError>
Call the guest’s init(source, ctx, args). The outer result is the host
surface; the inner Result<_, String> is the guest’s own WIT result
(an Err string is a source that declined to produce candidates).
Sourcepub async fn accept(
&self,
source: String,
ctx: PickerContext,
routing: RoutingPayload,
) -> Result<Result<PickerAcceptOutcome, String>, PluginHostError>
pub async fn accept( &self, source: String, ctx: PickerContext, routing: RoutingPayload, ) -> Result<Result<PickerAcceptOutcome, String>, PluginHostError>
Call the guest’s accept(source, ctx, routing) — translate the user’s
chosen routing token into a typed outcome the host applies.
Trait Implementations§
Source§impl Clone for PickerClient
impl Clone for PickerClient
Source§fn clone(&self) -> PickerClient
fn clone(&self) -> PickerClient
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 PickerClient
impl !UnwindSafe for PickerClient
impl Freeze for PickerClient
impl Send for PickerClient
impl Sync for PickerClient
impl Unpin for PickerClient
impl UnsafeUnpin for PickerClient
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